Page 1 of 1

No Client Notification when Server goes Away

Posted: 18 Oct 2012, 11:40
by homerlex
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?

Re: No Client Notification when Server goes Away

Posted: 26 Oct 2012, 10:29
by Lapo
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

Posted: 26 Oct 2012, 11:43
by homerlex
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

Posted: 26 Oct 2012, 13:50
by Lapo
Excellent, thanks