Problem with BlueBox connection

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

Moderators: Lapo, Bax

Evgeny
Posts: 15
Joined: 04 Jul 2008, 15:32

Problem with BlueBox connection

Postby Evgeny » 30 Jan 2009, 05:32

Hello, I have smartfox 1.6.3 installed on port 9339 and BlueBox on port 8080. When application connects to wrong port number (9330 instead of 9339) in order to force BlueBox connection, connection is established, but in couple second it disconnects.
I used http sniffer to trace requests:
1.
request: sfsHttp=connect
response: #567e47315f6541b9c7f0a8b163205813
2.
request: sfsHttp=567e47315f6541b9c7f0a8b163205813<msg t='sys'><body action='verChk' r='0'><ver v='156' /></body></msg>
response:
3.
request: sfsHttp=567e47315f6541b9c7f0a8b163205813poll
response: <?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>
<msg t='sys'><body action='apiOK' r='0'></body></msg>
4.
request: sfsHttp=567e47315f6541b9c7f0a8b163205813poll
response: ERR#01

bluebox.properties:

Code: Select all

#:::::::::::::::::::::::::::::::::::::::::::::::::::::::
# {{ SmartFoxServer - BlueBox }}
# Configuration File
# version 1.0
#
# (c) 2004-2007 gotoAndPlay()
# www.smartfoxserver.com
# www.gotoandplay.it
#:::::::::::::::::::::::::::::::::::::::::::::::::::::::

#log_level=FINER
log_level=INFO
log_folder=./logs/
log_max_size=100000
log_max_files=5

# Can be embedded or stand-alone
serverMode=embedded

# These 2 are available only in stand-alone mode
sfsAddr=127.0.0.1
sfsPort=9339

# This value should always be > 20. A value of 30 is recommended.
client_idle_time=30

# Allows runtime debugging
# You can point the browser to -> http://hostname:port/BlueBox/HttpBox.go?debugCmd=main
debug_mode=true


What am I doing wrong?
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Postby Lapo » 30 Jan 2009, 16:36

You don't seem to be doing anything wrong. However the socket policy seem to be interfering with the data being received on the client.
Quite strange, can you give me more details?
Are you testing this locally? or live?
Does it happen all the times if you perform a connection?
Lapo
--
gotoAndPlay()
...addicted to flash games
Evgeny
Posts: 15
Joined: 04 Jul 2008, 15:32

Postby Evgeny » 30 Jan 2009, 20:15

I'm testing this both locally and live and it happens all the times.
Login page appears for a second but then connection gets lost.
The server is running smartfox on port 9340 and bluebox in embedded mode on port 443. I put wrong port to game config so that bluebox connection is forced.
Last edited by Evgeny on 21 Feb 2009, 06:25, edited 1 time in total.
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Postby Lapo » 02 Feb 2009, 08:57

I am not able to reproduce the issue using SmartFoxServer 1.6.3 and BlueBox 1.0.5.
If you're not using the same BlueBox version (1.0.5) please try upgrading to the latest version, I think it should solve the problem.

The upgrade is available here -> http://www.smartfoxserver.com/products/ ... #downloads
Follow the installation instructions and let us know if it helps

Thank you
Lapo

--

gotoAndPlay()

...addicted to flash games
Evgeny
Posts: 15
Joined: 04 Jul 2008, 15:32

Postby Evgeny » 02 Feb 2009, 10:59

I updated BlueBox to version 1.0.5 but it dind't help :(.
This is part of server logs:

Code: Select all

INFO   | jvm 1    | 2009/02/02 15:03:38 | 2009-02-02 15:03:38.553::INFO:  Logging to STDERR via org.mortbay.log.StdErrLog
INFO   | jvm 1    | 2009/02/02 15:03:38 | 2009-02-02 15:03:38.664::WARN:  Deprecated configuration used for ./webserver/webapps
INFO   | jvm 1    | 2009/02/02 15:03:38 | 2009-02-02 15:03:38.694::INFO:  jetty-6.1.3
INFO   | jvm 1    | 2009/02/02 15:03:39 | 2009-02-02 15:03:39.226::INFO:  Extract jar:file:/usr/local/sfs_pre/Server/webserver/webapps/BlueBox.war!/ to /tmp/Jetty_0_0_0_0_443_BlueBox.war__BlueBox__w6uzrk/webapp
INFO   | jvm 1    | 2009/02/02 15:03:39 | ::::::::::: { BlueBox INITED } ::::::::::::
INFO   | jvm 1    | 2009/02/02 15:03:39 | :                                         :
INFO   | jvm 1    | 2009/02/02 15:03:39 | : Version 1.0.5 -- (c) 2008 gotoAndPlay() :
INFO   | jvm 1    | 2009/02/02 15:03:39 | :                                         :
INFO   | jvm 1    | 2009/02/02 15:03:39 | :::::::::::::::::::::::::::::::::::::::::::
INFO   | jvm 1    | 2009/02/02 15:03:39 | 2009-02-02 15:03:39.379::INFO:  Started SelectChannelConnector @ 0.0.0.0:443
INFO   | jvm 1    | 2009/02/02 15:03:39 | 15:03:39.385 - [ INFO ] > Starting h2 engine...


I noticed "Deprecated configuration" text. Could it be the reason?[/code]
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Postby Lapo » 02 Feb 2009, 11:48

No, that message is not important actually.
Could you send me the config.xml and bluebox.properties files? Both are located in the Server/ folder under your SFS installation directory.

You can zip them and send them to our email -> support {at} smartfoxserver.com

We'll take a look and see if there's some configuration problem.

Thank you
Lapo

--

gotoAndPlay()

...addicted to flash games
Evgeny
Posts: 15
Joined: 04 Jul 2008, 15:32

Postby Evgeny » 02 Feb 2009, 12:14

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

Postby Lapo » 02 Feb 2009, 18:04

Make sure to request the crossdomain policy from your code before calling the
connect()
method on the SmartFoxClient instance.

Code: Select all

Security.loadPolicyFile("xmlsocket://w.x.y.z:9339")

Where w.x.y.z:9339 is your server address and socket TCP port.

This should solve the problem
Lapo

--

gotoAndPlay()

...addicted to flash games
Evgeny
Posts: 15
Joined: 04 Jul 2008, 15:32

Postby Evgeny » 03 Feb 2009, 19:19

Security.loadPolicyFile didn't help. I tried it with server port, bluebox port - nothing changed.
I thought maybe I did something wrong in my application, so I tried "SmartFoxTris_AS3" example which comes with SmartFox. I changed server port to incorrect value and got exactly the same behaviour - login page appears for a second or two and then connection is lost.
Flash documentation (http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/system/Security.html says that "Upon establishing a connection with the specified port, Flash Player or AIR transmits <policy-file-request />, terminated by a null byte." if Security.loadPolicyFile("xmlsocket:...") is used.
But when connection to port 443 (bluebox port) is established, I don't see that client sends "<policy-file-request />", although I called Security.loadPolicyFile("xmlsocket://hostname:443") before connecting to server.
Also I should add that once my bluebox test worked properly. I have no ideas why it worked, because I didn't change anything in server configuration. After I restarted server, it stopped working.
Last edited by Evgeny on 21 Feb 2009, 06:25, edited 1 time in total.
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Postby Lapo » 04 Feb 2009, 12:58

Ok, I think we have to check this in steps.
First of all, go this page --> http://showcase.smartfoxserver.com/battleFarm/

It's our BlueBox demonstration game.
Click on the button in the middle, the one that says "force BlueBox connection" and let me know if you can get inside. It should work without problems.
Lapo

--

gotoAndPlay()

...addicted to flash games
Evgeny
Posts: 15
Joined: 04 Jul 2008, 15:32

Postby Evgeny » 04 Feb 2009, 13:04

Works fine.
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Postby Lapo » 04 Feb 2009, 13:30

ok great.
says that "Upon establishing a connection with the specified port, Flash Player or AIR transmits <policy-file-request />, terminated by a null byte." if Security.loadPolicyFile("xmlsocket:...") is used.
But when connection to port 443 (bluebox port) is established, I don't see that client sends "<policy-file-request />",

You won't see that unless you sniff the network traffic.

Next test:
Try this page it is a simple connector example, that attempts to connect to our live SFS with the wrong socket port number, failing back to BlueBox
http://showcase.smartfoxserver.com/connectionAS3/

After click connect I get this:

Code: Select all

--> Flash Player: MAC 10,0,12,36 / Mac OS 10.5.6
--> SFS Client API: 1.5.7
--> Connection successfull!
--> Connected via: http


You can download this example from here
You should be able to make it work on your server too.
Lapo

--

gotoAndPlay()

...addicted to flash games
Evgeny
Posts: 15
Joined: 04 Jul 2008, 15:32

Postby Evgeny » 05 Feb 2009, 17:04

You won't see that unless you sniff the network traffic.

I was sniffing the network traffic.

The example you gave works fine on your server, but on my server I get the following:

Code: Select all

--> Flash Player: WIN 10,0,12,36 / Windows XP
--> SFS Client API: 1.5.7
--> Connection successfull!
--> Connected via: http
--> Connection lost!
Last edited by Evgeny on 21 Feb 2009, 06:26, edited 1 time in total.
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Postby Lapo » 09 Feb 2009, 06:58

There could be a problem with the custom policy although I am not 100% sure. Could you please try reverting to the default policy of the server (comment out your external policy file in the config.xml) and try again?
This is probably the only difference between our test server and yours in terms of setup.
If this fixes the problem we'll look into that quickly.
Lapo

--

gotoAndPlay()

...addicted to flash games
Evgeny
Posts: 15
Joined: 04 Jul 2008, 15:32

Postby Evgeny » 09 Feb 2009, 09:44

I reverted to default policy, restarted server, but it didn't help.

Return to “BlueBox”

Who is online

Users browsing this forum: No registered users and 15 guests