Socket error after connect to BlueBox

Submit all your BlueBox related questions or report a bug here!

Moderators: Lapo, Bax

token
Posts: 6
Joined: 12 Oct 2009, 17:21

Socket error after connect to BlueBox

Postby token » 12 Oct 2009, 17:45

Hi,

I'm trying to use BlueBox for a game and after the connection fails to connect to the Smartfox server it connects sucessfully to the BlueBox.

but after a while, the SmartFoxClient generate the following error:

Error #2044: Unhandled securityError:. text=Error #2048: Security sandbox violation: file:///game.swf cannot load data from localhost:9331.

is like the socket connection is not closed correctly when the http connection is established.

to simulate that the smartfox server is not available, the game is connecting to the port 9331.

do you know what could be happening?

Thanks a lot!
User avatar
Lapo
Site Admin
Posts: 21229
Joined: 21 Mar 2005, 09:50
Location: Italy

Postby Lapo » 14 Oct 2009, 09:06

Hi,
we're aware of the error which seems to fire only under certain versions of the Flash Player 10. Actually we have tested several scenario and the error does not create any real problems to the proper functioning of the API.

Anyways we're going to handle it more gracefully with the next API update.
Lapo
--
gotoAndPlay()
...addicted to flash games
token
Posts: 6
Joined: 12 Oct 2009, 17:21

Postby token » 16 Oct 2009, 18:42

ok, thanks for the answer!

would you tell me when is the new release date?
User avatar
Lapo
Site Admin
Posts: 21229
Joined: 21 Mar 2005, 09:50
Location: Italy

Postby Lapo » 17 Oct 2009, 08:36

I have inspected the code for the change and I have found that it's probably not necessary to patch it. In fact all you need to do is to handle the error directly in your code by adding an event listener. This way you can decide what to do with it and the API won't "swallow" it.

Example:

Code: Select all

smartFox.addEventListener(SecurityErrorEvent.SECURITY_ERROR, myHanlder)


Let me know if it helps.
Lapo

--

gotoAndPlay()

...addicted to flash games
User avatar
rewb0rn
Posts: 174
Joined: 26 Jan 2009, 12:54
Location: Berlin, Germany

Postby rewb0rn » 04 Dec 2009, 15:04

Unfortunately it does not work here. I tried the exactly same thing but the event is not catched. I use the 1.6.6 as3 api. strangely the exception trace tells me the error appears in the line _sfs = new SmartFoxClient() but as no connecting is done there, that seems impossible. Also adding a try {} catch(e:SecurityError){} does not fix it. Any chance this is fixed within the 1.6.7 update?
User avatar
Lapo
Site Admin
Posts: 21229
Joined: 21 Mar 2005, 09:50
Location: Italy

Postby Lapo » 09 Dec 2009, 08:38

In the latest release of the API we catch the exception internally and trace it to the console. Re-launching it one level up to the developer seems to be causing more harm than good because many don't remember to do it.

Latest API download:
http://www.smartfoxserver.com/products/ ... d.php?d=88
Lapo

--

gotoAndPlay()

...addicted to flash games
User avatar
rewb0rn
Posts: 174
Joined: 26 Jan 2009, 12:54
Location: Berlin, Germany

Postby rewb0rn » 23 Mar 2010, 19:54

I still get the following exception when the server is offline



Error #2044: Unhandled securityError:. text=Error #2048: Security sandbox violation: [url] cannot load data from http://82.149.227.75:80/BlueBox/HttpBox.do.
at it.gotoandplay.smartfoxserver.http::LoaderFactory/getLoader()
at it.gotoandplay.smartfoxserver.http::HttpConnection/send()
at it.gotoandplay.smartfoxserver.http::HttpConnection/connect()
at it.gotoandplay.smartfoxserver::SmartFoxClient/tryBlueBoxConnection()
at it.gotoandplay.smartfoxserver::SmartFoxClient/handleSecurityError()
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at flash.net::Socket/onTimeout()
at flash.utils::Timer/_timerDispatch()
at flash.utils::Timer/tick()


I am not able to catch it and it prevents me from connecting to our second server. We are using the latest version in client and server. What can be done?

Thanks in advance.
User avatar
Lapo
Site Admin
Posts: 21229
Joined: 21 Mar 2005, 09:50
Location: Italy

Postby Lapo » 24 Mar 2010, 10:43

I am not to test the error right now, but aren't you listening for the onConnection event? The event will fire sending params.sucess == false, which indicates a connection failure.

At that point you can try another server.
Is this that you are doing?
Lapo

--

gotoAndPlay()

...addicted to flash games
User avatar
rewb0rn
Posts: 174
Joined: 26 Jan 2009, 12:54
Location: Berlin, Germany

Postby rewb0rn » 24 Mar 2010, 10:50

Yes I do that but apparently its not being executed or interrupted by the exception. I also added a listener for a SecurityErrorEvent to the sfs instance but its also not catching the exception.
User avatar
rewb0rn
Posts: 174
Joined: 26 Jan 2009, 12:54
Location: Berlin, Germany

Postby rewb0rn » 26 Mar 2010, 10:11

I just did another test.. The code in the "onConnection" event is definitely not being executed. This is the exception including code lines:

Error #2044: securityError unverarbeitet. text=Error #2048: Verletzung der Sicherheits-Sandbox: [url] kann keine Daten von http://localhost:8080/BlueBox/HttpBox.do laden.
at it.gotoandplay.smartfoxserver.http::LoaderFactory/getLoader()[E:\01_http\rubens_doppelkopf\src\frontend\src\it\gotoandplay\smartfoxserver\http\LoaderFactory.as:36]
at it.gotoandplay.smartfoxserver.http::HttpConnection/send()[E:\01_http\rubens_doppelkopf\src\frontend\src\it\gotoandplay\smartfoxserver\http\HttpConnection.as:89]
at it.gotoandplay.smartfoxserver.http::HttpConnection/connect()[E:\01_http\rubens_doppelkopf\src\frontend\src\it\gotoandplay\smartfoxserver\http\HttpConnection.as:69]
at it.gotoandplay.smartfoxserver::SmartFoxClient/tryBlueBoxConnection()[E:\01_http\rubens_doppelkopf\src\frontend\src\it\gotoandplay\smartfoxserver\SmartFoxClient.as:2979]
at it.gotoandplay.smartfoxserver::SmartFoxClient/handleSecurityError()[E:\01_http\rubens_doppelkopf\src\frontend\src\it\gotoandplay\smartfoxserver\SmartFoxClient.as:3000]
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at flash.net::Socket/onTimeout()
at flash.utils::Timer/_timerDispatch()
at flash.utils::Timer/tick()



Should I catch the exception myself manipulating the api code? As long as it helps this would be an option.

Thanks,
Ruben
User avatar
Lapo
Site Admin
Posts: 21229
Joined: 21 Mar 2005, 09:50
Location: Italy

Postby Lapo » 26 Mar 2010, 14:51

It sounds like we're not looking at the same thing.
I definitely get the onConnection event when running the client and the SmartFox is not running.

Can you please try the example found in {your-sfs-dir}/Examples/AS3/template_AS3

I can run that example both with the standalone player and the browser and get the same result. Tried with API version 1.5.8 and 1.6.2

Here's a screenshot
Image
Lapo

--

gotoAndPlay()

...addicted to flash games
User avatar
rewb0rn
Posts: 174
Joined: 26 Jan 2009, 12:54
Location: Berlin, Germany

Postby rewb0rn » 26 Mar 2010, 16:49

Its printing the same exception here. My interface looks slightly different than yours and IIRC I downloaded the 1.6.6 installer version and upgraded to 1.6.8, so could you try it with the latest client API please?

http://www.imagebanana.com/view/nvcatyf ... atesfs.png
Image

Translated to english the message says

Security sandbox violation: [url] cannot load data from [url2]

Thanks
User avatar
Lapo
Site Admin
Posts: 21229
Joined: 21 Mar 2005, 09:50
Location: Italy

Postby Lapo » 29 Mar 2010, 19:52

Can you please send me your compiled SWF file?
Please use Support > Contact us, referencing this post.

Thanks
Lapo

--

gotoAndPlay()

...addicted to flash games
User avatar
rewb0rn
Posts: 174
Joined: 26 Jan 2009, 12:54
Location: Berlin, Germany

Postby rewb0rn » 22 Apr 2010, 09:19

Hi,

I have sent you the mail round about 3 weeks ago but have not yet received an answer, have you been able to reproduce the problem?

Thanks,
Ruben
User avatar
Lapo
Site Admin
Posts: 21229
Joined: 21 Mar 2005, 09:50
Location: Italy

Postby Lapo » 22 Apr 2010, 11:36

Hi,
I don't recall having received the email you mentioned, but can't be sure at the moment and I apologize in advance if I didn't reply. I'll go back and take a look, including the spam folder :(

Also if you could resend it it would be terrific.
Sorry for the inconvenience.
Lapo

--

gotoAndPlay()

...addicted to flash games

Return to “BlueBox”

Who is online

Users browsing this forum: No registered users and 1 guest