Reconnect to server
-
Darkwing Duck
- Posts: 20
- Joined: 21 Dec 2010, 13:17
Reconnect to server
Hi!
How i can reconnect to the server?
i try that:
[code]_sfs.disconnect();
_sfs.connect(IP, GameParametersProxy.instance.port);[/code]
How i can reconnect to the server?
i try that:
[code]_sfs.disconnect();
_sfs.connect(IP, GameParametersProxy.instance.port);[/code]
Last edited by Darkwing Duck on 05 May 2011, 07:53, edited 1 time in total.
-
Darkwing Duck
- Posts: 20
- Joined: 21 Dec 2010, 13:17
Then you need to give it a pause. The disconnection doesn't happen instantaneously. Your reconnection attempt is too fast.
You should at least wait for the disconnection event.
In alternative you can call disconnect to close the previous connection and create a new SmartFox object that you connect to the new IP.
You should at least wait for the disconnection event.
In alternative you can call disconnect to close the previous connection and create a new SmartFox object that you connect to the new IP.
-
Darkwing Duck
- Posts: 20
- Joined: 21 Dec 2010, 13:17
No I don't think so.
Take a look a the stack trace:
You should probably make a more graceful disconnection, where you first turn off OpenSpace and then disconnect the socket.
Take a look a the stack trace:
The cause of the problem is a SetUserVariables Request. Maybe it happens concurrently with the disconnection because of an OpenSpace event.at flash.net::Socket/writeBytes()
at it.gotoandplay.smartfoxserver::SmartFoxClient/writeToSocket()
at it.gotoandplay.smartfoxserver::SmartFoxClient/send()
at it.gotoandplay.smartfoxserver::SmartFoxClient/setUserVariables()
at com.smartfoxserver.openspace.engine.control::OpenSpaceController/
You should probably make a more graceful disconnection, where you first turn off OpenSpace and then disconnect the socket.
-
Darkwing Duck
- Posts: 20
- Joined: 21 Dec 2010, 13:17
well..
1. how i can turn off the openspace?
2. when this exception is not appear, i see this:
[quote]****************************************************************
Internal error:
The room list is empty!
The client API cannot function properly until the room list is populated.
Please consult the documentation for more infos.
****************************************************************
[Sending]: <msg t='sys'><body action='verChk' r='0'><ver v='157' /></body></msg>
[ RECEIVED ]: <cross-domain-policy><allow-access-from domain='*' to-ports='9339' /></cross-domain-policy>, (len: 91)
[ RECEIVED ]: <msg t='sys'><body action='apiOK' r='0'></body></msg>, (len: 53)
[/quote]
1. how i can turn off the openspace?
2. when this exception is not appear, i see this:
[quote]****************************************************************
Internal error:
The room list is empty!
The client API cannot function properly until the room list is populated.
Please consult the documentation for more infos.
****************************************************************
[Sending]: <msg t='sys'><body action='verChk' r='0'><ver v='157' /></body></msg>
[ RECEIVED ]: <cross-domain-policy><allow-access-from domain='*' to-ports='9339' /></cross-domain-policy>, (len: 91)
[ RECEIVED ]: <msg t='sys'><body action='apiOK' r='0'></body></msg>, (len: 53)
[/quote]
-
dean graziosi
- Posts: 5
- Joined: 18 Apr 2011, 07:14