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
onConnectionError
Yes i do it
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
Step by step
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
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
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.
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.
Return to “SmartFoxBits for SFS 1.x”
Who is online
Users browsing this forum: No registered users and 16 guests