No Client Notification when Server goes Away
Posted: 18 Oct 2012, 11:40
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?
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?