Blue Box giving bug

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

Moderators: Lapo, Bax

diamond123
Posts: 46
Joined: 28 Nov 2009, 04:30

Postby diamond123 » 26 Dec 2009, 08:26

Yup, that is what i am talking about. (smartConnect)

If i set smartConnect to false in the client and run it without a server i get back the connection fault.

But if i set the smartConnect flag to true, i get a null error in constructor of SmartFoxClient.
User avatar
Lapo
Site Admin
Posts: 20277
Joined: 21 Mar 2005, 09:50
Location: Italy

Postby Lapo » 28 Dec 2009, 09:24

Ok,I am using the AS3 template provided with SFS 1.6.x
smartConnect is always set to false
No SmartFoxServer running
I test with the API coming in 1.6.6 --> API version 1.5.8
Result:
--> SmartFoxClient API version: 1.5.8
--> Click the CONNECT button to start
--> Connecting...
--> Connection failed!

I test with API coming with 1.6.8 --> API version 1.6.1
Result:
--> SmartFoxClient API version: 1.6.1
--> Click the CONNECT button to start
--> Connecting...
--> Connection failed!


I am not able to reproduce what you are saying: in both cases the connection problem is handled correctly in the API event, and since there is no server running there are much less variables to take into account.
Lapo
--
gotoAndPlay()
...addicted to flash games
diamond123
Posts: 46
Joined: 28 Nov 2009, 04:30

Postby diamond123 » 29 Dec 2009, 08:39

The error is supposed to come when smartConnect is enabled.
But i am not able to reproduce it anymore. I have gone much ahead in my project without smartConnect. And the error cannot be reproduced at this time.

But i still can't make Blue box work.
but now error is different. It is some security problem.

Without bluebox everything works fine. But when i turn on BlueBox, it throws up a Security error.
I think it is because i am hosting my swf on a different machine and the sfs server is running on a separate machine. But i thought, using crossdomain.xml should solve this. But it only took care of non-BluBox connections. BlueBox connection still gives Security error.
Any ideas on this. Maybe after i solve this our original problem may crop up or may be not.
Thanks for ur help so far.
User avatar
Lapo
Site Admin
Posts: 20277
Joined: 21 Mar 2005, 09:50
Location: Italy

Postby Lapo » 29 Dec 2009, 08:43

The error is supposed to come when smartConnect is enabled.

Actually you said the opposite in the previous post ;)

. I have gone much ahead in my project without smartConnect. And the error cannot be reproduced at this time.

Being a connection problem I would think it is independent from your advancements in the application logic.

Without bluebox everything works fine. But when i turn on BlueBox, it throws up a Security error.
I think it is because i am hosting my swf on a different machine and the sfs server is running on a separate machine. But i thought, using crossdomain.xml should solve this.


As usual, if you can provide a step by step description of the issue, we'll be happy to help.
Lapo

--

gotoAndPlay()

...addicted to flash games
diamond123
Posts: 46
Joined: 28 Nov 2009, 04:30

I am back

Postby diamond123 » 09 Feb 2010, 06:16

@Lapo
Sorry for the absenc and late reply

Ok, i cannot give the simulation steps. (confidential) :wink:

So i know you will have difficulty helping me.
But i can tell you my debug traces

One thing i feel that is creating a problem, is that when the connection fails and the swf reverts to bluebox i get a warning in the trace saying
"Failed to load the policy file from *******.

The ******* is where i feel the bug is at because it gives me an incorrect address. which is a s follows "http://http:/crossdomain.xml".

Where is it getting this from??
Any ideas?
diamond123
Posts: 46
Joined: 28 Nov 2009, 04:30

More

Postby diamond123 » 09 Feb 2010, 06:18

The above warning is followed by a security error that has already been described by many (including myself) on the forum before.

viewtopic.php?t=6117
diamond123
Posts: 46
Joined: 28 Nov 2009, 04:30

Solved but not solved

Postby diamond123 » 10 Feb 2010, 13:39

I solved the above mentioned problem.
Where it would show wrong ip

But the problem still persists.
I see that it now says

Failed to load the policy file from http://correct_ip:8080/crossdomain.xml

Now i see that the file is present in the root directory of the embedded server.

Then why does the client not get the file.

That crashes the rest of the thing.

Also when server is down, bluebox connection attempt gives an error for the same reason. As policy file is not loaded, urlloader throws up a security error.

Some things i have not mentioned so far
1. My swf is running from a different server running on a different machine (say machine A)
2. Smartfox is running (along with embedded webserver) on one machine (say machine B)
3. Also machine B (where smartfox is running) also has an apache server running on port 80 along with a mySql database running at 3306.

Does this make any sense.

@Lapo
And the absence of policy file when server is offline causes bluebox to give a security error.
Probably because the swf is from a different server.

Some one please help?? :?
diamond123
Posts: 46
Joined: 28 Nov 2009, 04:30

Calling for Lapo, the Awesome

Postby diamond123 » 12 Feb 2010, 09:04

Lapo,
Where are you?
Please help :wink:
User avatar
Lapo
Site Admin
Posts: 20277
Joined: 21 Mar 2005, 09:50
Location: Italy

Postby Lapo » 12 Feb 2010, 10:46

Again, let's try to separate one problem from another.

The crossdomain issue sounds strange to me and I don't think I ever stumbled on that problem before. I would very much like to try connecting to your server if it's running on a public IP. If so send me a PM with the address.

The 2nd issue: of course if SmartFox is not running you won't be able to connect. The BlueBox just tunnels the connection to SmartFox.
If SmartFox is down no one will ever be able to connect to it, regardless of the type of connection it is using (socket or http)
Lapo

--

gotoAndPlay()

...addicted to flash games
diamond123
Posts: 46
Joined: 28 Nov 2009, 04:30

Postby diamond123 » 12 Feb 2010, 12:18

The two issues you have mentioned are correct.

The crossdomain issue sounds strange to me and I don't think I ever stumbled on that problem before. I would very much like to try connecting to your server if it's running on a public IP. If so send me a PM with the address.


The beta version should soon go public, but we wanted to solve the bluebox problem before that. If we can't, you should be able to see the problem soon.

The 2nd issue: of course if SmartFox is not running you won't be able to connect. The BlueBox just tunnels the connection to SmartFox.
If SmartFox is down no one will ever be able to connect to it, regardless of the type of connection it is using (socket or http)


The connection between the two issues. -
I will explain step by step -
May be you will be a able to simulate it.

1. User opens up swf from ip1.
2. This swf tries to connect to Smartfoxserver on ip2 using socket connection.
3. Since server is not running, swf tries to establish a Bluebox connection.
3.1. To establish a bluebox connection, the swf looks for the crossdomain.xml policy file. This is where it fails saying that it was unable to load the policy file.

That is expected because it cannot find a file on a server which is not running. But in that case, it throws up a security null error -
What it should have done is that, if it was unable to load the policy file, it should have stopped further execution, but it did not. It continued to establish a httpconnection which then gave a security error as it did not have the necessary permissions.

Note - there is a seperate apache http server running on the same machine. Maybe that is causing the conflict. I am not sure. Don't have much knowledge of server mechanisms.

Again, i am not expecting the swf to connect to the server which is not running. NO.

All i want is that it should not show a null error to my end user. Instead I should be able to show some pop message. But i have tried a lot to catch the error, but nothing seems to be working.

Again, I have no problem with BlueBox running so far. Its the bluebox connection attempt that gives a null error if server is down.

Thank you,

Keep up the awesome work, Lapo.

@Lapo
Just out of curiosity, how many years have you been working in the flash/ multiplayer/ game industry? Its really an awesome thing that you have built here - SmartFoxServer. Saved me a lot of work.


P.S. This is my longest post here.
User avatar
Lapo
Site Admin
Posts: 20277
Joined: 21 Mar 2005, 09:50
Location: Italy

Postby Lapo » 15 Feb 2010, 14:40

Note - there is a seperate apache http server running on the same machine. Maybe that is causing the conflict. I am not sure. Don't have much knowledge of server mechanisms.

Well yes this could be very much the cause of the problem.
Let me just be more clear on a couple of points:
1. the SFS API first try the socket and then the BBox connection, and if none of them work they will return a connection failure.

2. The BlueBox by default runs on port 8080, but you can change it to 80 (http) or 443 (https) as we recommend. Ina any case, if SmartFoxServer is not running there shouldn't be any service responding on the BlueBox port.
So if port 8080 is reserved for the Bluebox you shouldn't run another service there when you expect SmartFox+BBox responding on the machine.
It would represent a port conflict and it would render the BlueBox inoperative even if you launched SmartFox.

This is probably the whole point of the problem. It is very much likely that your webserver is actually colliding with the BlueBox port.
The solution here is to make sure that both services run on different ports and don't conflict with each others.

One fundamental rule in TCP sockets is that one service can use one port.

hope it helps
Lapo

--

gotoAndPlay()

...addicted to flash games
diamond123
Posts: 46
Joined: 28 Nov 2009, 04:30

Postby diamond123 » 16 Feb 2010, 13:10

Thanks Lapo,
I will look into the port conflict , if it is happening.

P.S. I was beginning to feel , you have decided to ignore my posts, since I am stuck at such a basic problem.
But thats not the case.
So thanks and keep up the good work.
Dod
Posts: 19
Joined: 25 Aug 2009, 17:20

Postby Dod » 03 Mar 2010, 13:19

Hello, i have the same problem but i think you were confused by many words here...

my application runs perfect but.....when i change smartconnect to true i never get ConnectionLost (if server is unavailable for any reason) so i can not inform user to try to connect again!!!

the only message i take is:

Unhandled securityError:. text=Error #2048: Security sandbox violation: http://ip/file.swf cannot load data from http://192.168.1.1:8080/BlueBox/HttpBox.do.

smartfox server + bluebox server are unavailable for any reason, why i can not get a connection lost or something event dispatched in smartfox to inform user that server is unavailble and i have an exception in flash debug player only?
User avatar
Lapo
Site Admin
Posts: 20277
Joined: 21 Mar 2005, 09:50
Location: Italy

Postby Lapo » 03 Mar 2010, 15:26

If you take any example application and run it without the server running it will fire a "Can't connect" error.
By default the smartConnect is always ON.

I suppose you are using a recent SFS PRO version?
If you could provide more details...

For reference take the Examples/template_AS3 example and run it with the server NOT running.
Lapo

--

gotoAndPlay()

...addicted to flash games
Dod
Posts: 19
Joined: 25 Aug 2009, 17:20

Postby Dod » 03 Mar 2010, 16:19

Ok thank you!!! My fault

It was needed to add sfs.addEventListener(SecurityErrorEvent.SECURITY_ERROR, onSecurityError)

But there is another problem, i tried this on smartfox example, i stop smartfox service i get security error normally i start smartfox service and i press connect and it never connects! it keeps sending security error....i need to refresh page to connect (some caching in security error from browser?)

Return to “BlueBox”

Who is online

Users browsing this forum: No registered users and 5 guests