SmartFox2XClient object returns isConnected == YES at the moment of the event "disconnect".
This happens after I have waited the "userReconnectionSeconds" time to test my logic.
I tried to dispatch the check with 2 seconds delay. It still returns YES.
[BUG][iOS1.3.7] SmartFox2XClient isConnected not updated
Re: [BUG][iOS1.3.7] SmartFox2XClient isConnected not updated
I am experiencing same issue.
I am receiving onConnectionLost event (event.type = 'disconnect' instead of 'connectionLost') and propagate it to checkConnectionEstablished method.
In checkConnectionEstablished I use isConnected from SmartFox2XClient and get YES.
Any updates or simple work-arounds?
I am receiving onConnectionLost event (event.type = 'disconnect' instead of 'connectionLost') and propagate it to checkConnectionEstablished method.
In checkConnectionEstablished I use isConnected from SmartFox2XClient and get YES.
Any updates or simple work-arounds?
Re: [BUG][iOS1.3.7] SmartFox2XClient isConnected not updated
Hi,
we're currently working on a number of fixes/additions which will include this as well.
I am not sure about event.type problem. Normally you just need to add the <ISFSEvents> protocol to your event listener class, then implement the relevant event methods. Eg: onConnection, onConnectionLost etc...
A simple workaround is to set your own "connected" flag when the connection event is triggered.
Moreover if you are dispatching a disconnection event to some other methods it is expected that the isConnected method will always report NO. This is to say that checking such flag is redundant when you are delegating the disconnection event.
Make sense?
we're currently working on a number of fixes/additions which will include this as well.
I am not sure about event.type problem. Normally you just need to add the <ISFSEvents> protocol to your event listener class, then implement the relevant event methods. Eg: onConnection, onConnectionLost etc...
A simple workaround is to set your own "connected" flag when the connection event is triggered.
Moreover if you are dispatching a disconnection event to some other methods it is expected that the isConnected method will always report NO. This is to say that checking such flag is redundant when you are delegating the disconnection event.
Make sense?
Re: [BUG][iOS1.3.7] SmartFox2XClient isConnected not updated
Hi,
Thank you for the answer.
Yes, it makes sense.
The bug with event types is reported here: viewtopic.php?f=21&t=17509
I also found, when I use Android SDK I can catch handshake event (it comes in dispatchEvent method), and there are no such an event in iOS SDK (onConnectionHandshake ?).
Back to the topic, we ended up with wrapping our own "connected" flag.
We are dispatching appearance of a disconnection event to the checkConnectionEstablished, but actually not the value of connection status. checkConnectionEstablished is separated and gets the status from "connected" flag. We also had to use killConnection to let the retrying mechanism connect again.
Thank you for the answer.
Yes, it makes sense.
The bug with event types is reported here: viewtopic.php?f=21&t=17509
I also found, when I use Android SDK I can catch handshake event (it comes in dispatchEvent method), and there are no such an event in iOS SDK (onConnectionHandshake ?).
Back to the topic, we ended up with wrapping our own "connected" flag.
We are dispatching appearance of a disconnection event to the checkConnectionEstablished, but actually not the value of connection status. checkConnectionEstablished is separated and gets the status from "connected" flag. We also had to use killConnection to let the retrying mechanism connect again.
Re: [BUG][iOS1.3.7] SmartFox2XClient isConnected not updated
mack wrote:Hi,
The bug with event types is reported here: viewtopic.php?f=21&t=17509
I also found, when I use Android SDK I can catch handshake event (it comes in dispatchEvent method), and there are no such an event in iOS SDK (onConnectionHandshake ?).
You can catch the handshake event, but it's undocumented and not useful to the developer.
We are dispatching appearance of a disconnection event to the checkConnectionEstablished, but actually not the value of connection status. checkConnectionEstablished is separated and gets the status from "connected" flag. We also had to use killConnection to let the retrying mechanism connect again.
[/quote]
I see. However when you dispatch a disconnection event there is no point in checking the status of the connection, because you just got disconnected.
If you are using the reconnection system, the disconnection event will fire if and only if the reconnection failed.
thanks
Return to “SFS2X iPhone / iPad / OSX API”
Who is online
Users browsing this forum: No registered users and 35 guests