onConnectionError

Everything about the SmartFoxBits UI Components for SmartFoxServer 1.x. Post your questions, suggestions and bug reports.

Moderators: Lapo, Bax

pac00l
Posts: 8
Joined: 24 Aug 2008, 00:56

onConnectionError

Postby pac00l » 13 Oct 2008, 17:32

how can i catch on connection error like this

** Socket connection failed. Trying BlueBox **
[ Send ]: connect
Error opening URL 'http://127.0.0.1:8080/BlueBox/HttpBox.do'
---> Status received: 2228541736

on error i want to try again
User avatar
Bax
Site Admin
Posts: 4608
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Postby Bax » 14 Oct 2008, 07:56

Register to the onConnection event on the Connector instance.
Paolo Bax
The SmartFoxServer Team
pac00l
Posts: 8
Joined: 24 Aug 2008, 00:56

Yes i do it

Postby pac00l » 14 Oct 2008, 11:17

Yes, i do it, i have that event but for example if i dissconect of my red when it is connecting status, onconnection don't catch the error
User avatar
Bax
Site Admin
Posts: 4608
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Postby Bax » 14 Oct 2008, 11:26

Sorry, this is not clear. Can you please better describe the steps to reproduce the issue?
Paolo Bax
The SmartFoxServer Team
pac00l
Posts: 8
Joined: 24 Aug 2008, 00:56

Step by step

Postby pac00l » 14 Oct 2008, 11:47

Step by step
first case

1) i have this function

function onConnection(evt:SFSEvent):Void {

if (evt.params.success == false) {
time_connect = setTimeout(connect_again, 100, "Try again");
}

}

2)Run the program
3)I get the message in console
[Sending]: <msg t='sys'><body action='verChk' r='0'><ver v='152' /></body></msg>
then my Cable Internet Disconnects.
4)Wait forever the event onConnection

Second case:

function connect_again(){
mc_connector.connect();
}
function onConnectionLost(evt:SFSEvent):Void {

time_connect = setTimeout(connect_again, 100, "Try again");
}
1)Wait to connect successful
2)then my Cable Internet Disconnects.
3)I get the message in console
[Sending]: <msg t='sys'><body action='verChk' r='0'><ver v='152' /></body></msg>
then my Cable Internet connect.
4)Wait the event onConnectionLost and connect_again
5)i get the message
[Sending]: <msg t='sys'><body action='verChk' r='0'><ver v='152' /></body></msg>

[Received]: <cross-domain-policy><allow-access-from domain="*" to-ports="9339" /></cross-domain-policy>

6)Can't connect again
User avatar
Lapo
Site Admin
Posts: 22999
Joined: 21 Mar 2005, 09:50
Location: Italy

Postby Lapo » 15 Oct 2008, 08:54

If you pull the network cable right in the middle of the handshake it's possible that you don't get the disconnection event.
This is due to the underlying TCP implementation, so there's not much to do about it. The disconnection will be notified later when the TCP connection timeout finally expires.

And, btw, this is a very particular case.
Lapo
--
gotoAndPlay()
...addicted to flash games

Return to “SmartFoxBits for SFS 1.x”

Who is online

Users browsing this forum: No registered users and 3 guests