Can't connect to BlueBox

Post here your questions about SFS2X. Here we discuss all server-side matters. For client API questions see the dedicated forums.

Moderators: Lapo, Bax

Post Reply
Damace
Posts: 58
Joined: 04 Jul 2011, 16:45

Can't connect to BlueBox

Post by Damace »

Hi everyone!

I've got some BlueBox problems.
Here is how I connect to the SmartFoxServer:

Code: Select all

sfs = new SmartFox();
sfs.useBlueBox = true;
sfs.connect("some-ip-adress", 9933);
To test BlueBox I close the 9933 port on my machine and start the application. Everything works fine. sfs.connectionMode reports that I'm connected through http.

Problem arises when I deploy my application to the social network. When I leave 9933 port open - it works fine. When I close it and wait for the BlueBox to kick in - it doesn't.

Second thing that I've noticed - when I connect to the server from my machine the application almost instantly knows that the 9933 port is closed and tries to connect trough http (I immediately catch the CONNECTION_ATTEMPT_HTTP event). But when I start the application on the social network it takes 20 seconds to realize that it needs to fall back and use BlueBox (the same event is fired only after 20 seconds).

Any ideas why my application can't connect to BlueBox when is on the social network's server?

P.S. My server is a VPS and is not local to my machine. Both of the tests (from my machine and from social network's) are done over the internet.

P.P.S. I added a line to crossdomains.xml:

Code: Select all

<allow-access-from domain="*" to-ports="8080" />
no luck.
Damace
Posts: 58
Joined: 04 Jul 2011, 16:45

Post by Damace »

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

Post by Lapo »

Hi,
Problem arises when I deploy my application to the social network. When I leave 9933 port open - it works fine. When I close it and wait for the BlueBox to kick in - it doesn't.
Make sure that the http-server is not blocked in the live setup.
But when I start the application on the social network it takes 20 seconds to realize that it needs to fall back and use BlueBox (the same event is fired only after 20 seconds).

Yes, this is normal. It takes 20 seconds for the FlashPlayer (broswer plugin) to actually fail/time-out.

The good news is that in the new API update we're going to release pretty soon we'll be able to bring that timeout back to an easier valuer (6-7 seconds). Adobe introduced a socket.timeOut parameter back in the days when the FlashPlayer 10 was out but it was buggy and never worked. Recently they have fixed it so now it is usable

cheers
Lapo
--
gotoAndPlay()
...addicted to flash games
Damace
Posts: 58
Joined: 04 Jul 2011, 16:45

Post by Damace »

How can I make sure that the http-server is not blocked in the live setup?

I can telnet ports 80 and 8080. But I can't telnet 9933.

Also there is another symptom - I can't connect to the AdminTool. I can load the login page, but when I enter all the info I just gets stuck and then reports a problem: Invalid administration TCP port.
User avatar
Lapo
Site Admin
Posts: 23438
Joined: 21 Mar 2005, 09:50
Location: Italy

Post by Lapo »

As regards port 9933 I think you didn't configure your server correctly.
Using the AdminTool > ServerConfigurator you can configure the Admin access in the RemoteAdmin tab.

Probably you won't be able to do this now, if you can't run the AdminTool, so the only way around this is to go edit manually the SFS2X/config/Server.xml file.

As regards port 8080, if it is reachable, you should be able to use the BlueBox. If not you should check either the Flash debug logs or the server side logs.
Lapo
--
gotoAndPlay()
...addicted to flash games
Damace
Posts: 58
Joined: 04 Jul 2011, 16:45

Post by Damace »

Ok, I caught the flash player error. It's a sandbox violation.

Code: Select all

Error #2044: Unhandled securityError:. text=Error #2048: Security sandbox violation: http://cs5202.vk.com/u23515002/bcc9cfc24fd272.zip cannot load data from http://31.186.103.25:8080/BlueBox/BlueBox.do.
	at com.smartfoxserver.v2.bitswarm.bbox::BBClient/getLoader()
	at com.smartfoxserver.v2.bitswarm.bbox::BBClient/sendRequest()
	at com.smartfoxserver.v2.bitswarm.bbox::BBClient/connect()
	at com.smartfoxserver.v2.bitswarm::BitSwarmClient/connect()
	at com.smartfoxserver.v2::SmartFox/handleConnectionProblem()
	at com.smartfoxserver.v2::SmartFox/onSocketSecurityError()
	at flash.events::EventDispatcher/dispatchEventFunction()
	at flash.events::EventDispatcher/dispatchEvent()
	at com.smartfoxserver.v2.bitswarm::BitSwarmClient/onSocketSecurityError()
	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()
Whats up wit dat?)
User avatar
Lapo
Site Admin
Posts: 23438
Joined: 21 Mar 2005, 09:50
Location: Italy

Post by Lapo »

No idea :)
What is this --> http://cs5202.vk.com/u23515002/bcc9cfc24fd272.zip
Is it part of your application?
Lapo
--
gotoAndPlay()
...addicted to flash games
Damace
Posts: 58
Joined: 04 Jul 2011, 16:45

Post by Damace »

I guess)

This is how it works:
1. You make an app
2. You upload the SWF to the social network's server
3. The game becomes available for everyone to play

I can tell you only about the first step. What does vk.com do after I uploaded my app on their servers - only god knows (and their staff). In this case I guess they zipped it.
User avatar
Lapo
Site Admin
Posts: 23438
Joined: 21 Mar 2005, 09:50
Location: Italy

Post by Lapo »

There is a crossdomain issue.
Your app is on the social network website, but your server is not the same domain... hence cross-domain problems.
If you go here -> http://31.186.103.25:8080/crossdomain.xml
you will notice that there's a 404 error. I think this is the problem.

My suggestion is to create a crossdomain.xml file under SFS2X/www/root/ with this XML:

Code: Select all

<?xml version="1.0"?>
<!DOCTYPE cross-domain-policy 
  SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd">
<cross-domain-policy>
  <allow-access-from domain="*" />
</cross-domain-policy>
Then clear your browser's cache and try again.

cheers
Lapo
--
gotoAndPlay()
...addicted to flash games
Post Reply