SFS: 2.3.0
Client: 1.0.1
I have a Java client listening for Connection Lost:
sfsClient.addEventListener(SFSEvent.CONNECTION_LOST, this);
This seems to work fine when the server disconnects the user (after a timeout). However, if the server crashes (or goes down for whatever reason) the client gets no notification. I do see the following messages logged by the API client but no events make it to my app:
07:31:01,423 ERROR [New I/O client worker #1-1] sockets.TCPSocketLayer - TCPSocketLayer: Socket error: An existing connection was forcibly closed by the remote host
07:31:01,424 INFO [New I/O client worker #1-1] core.EventDispatcher - Dispatching event OnError to 1 listeners
07:31:01,424 INFO [New I/O client worker #1-1] core.EventDispatcher - Dispatching event ioError to 1 listeners
07:31:01,424 INFO [New I/O client worker #1-1] core.EventDispatcher - Dispatching event OnDisconnect to 1 listeners
I tried adding a listener like this but it doesn't do anything:
sfsClient.addEventListener("OnDisconnect", this);
Is there any way to detect a lost connection for this kind of condition so that we can initiate a reconnect?
No Client Notification when Server goes Away
Re: No Client Notification when Server goes Away
We have just released an update (v 1.0.4) --> you can get it here: http://www.smartfoxserver.com/download/sfs2x#p=updates
It should solve your problem.
Let me know how it works for you
Cheers
It should solve your problem.
Let me know how it works for you
Cheers
Re: No Client Notification when Server goes Away
Works perfectly. Thanks!
Lapo wrote:We have just released an update (v 1.0.4) --> you can get it here: http://www.smartfoxserver.com/download/sfs2x#p=updates
It should solve your problem.
Let me know how it works for you
Cheers
Re: No Client Notification when Server goes Away
Excellent, thanks
Return to “SFS2X Java / Android API”
Who is online
Users browsing this forum: No registered users and 16 guests