Reconnection system issues
Posted: 24 Oct 2012, 15:05
I'm currently trying to implement the reconnection system in SmartFoxServer 2x (2.3.0).
I'm having both issues with the Flash and the Java client library.
I set the reconnection time to 60 seconds in the zone xml file.
Basically I setup some logging on both the client and the server, telling me when the CONNECTION_RETRY and CONNECTION_RESUME events are triggered.
I then connect with a java client to the server, make sure it's connected and then unplug my network cable.
After a while I get the following:
The [TEST] bits are what I log. All of this happens within a few seconds of each other.
Then I plug the cable back in, but nothing happens. If I try to do something I get the following error:
I can see the connection retry event is triggered, but nothing happens (not when I plug it back it, or when I wait 60 seconds).
I also noticed that it's dispatching an event on 'OnDisconnect', but I don't seem to get this (even though I listen to CONNECTION_LOST).
The same happens with our Flash client (although there I do get the CONNECTION_LOST event triggered, slightly after the CONNECTION_RETRY event is triggered).
Am I doing something wrong? Or is there are bug in the client libraries?
(I already made sure both client libraries are the latest from the download page)
I'm having both issues with the Flash and the Java client library.
I set the reconnection time to 60 seconds in the zone xml file.
Basically I setup some logging on both the client and the server, telling me when the CONNECTION_RETRY and CONNECTION_RESUME events are triggered.
I then connect with a java client to the server, make sure it's connected and then unplug my network cable.
After a while I get the following:
Code: Select all
56248 [New I/O client worker #1-1] ERROR sfs2x.client.core.sockets.TCPSocketLayer - TCPSocketLayer: Socket error: An existing connection was forcibly closed by the remote host
56248 [New I/O client worker #1-1] INFO sfs2x.client.core.EventDispatcher - Dispatching event OnError to 1 listeners
56249 [New I/O client worker #1-1] INFO sfs2x.client.core.EventDispatcher - Dispatching event ioError to 1 listeners
56249 [New I/O client worker #1-1] INFO sfs2x.client.core.EventDispatcher - Dispatching event OnDisconnect to 1 listeners
56249 [New I/O client worker #1-1] INFO sfs2x.client.bitswarm.BitSwarmClient - Attempting reconnection in 1000 msec
56249 [New I/O client worker #1-1] INFO sfs2x.client.core.EventDispatcher - Dispatching event reconnectionTry to 1 listeners
56249 [New I/O client worker #1-1] INFO sfs2x.client.core.EventDispatcher - Dispatching event connectionRetry to 1 listeners
[TEST] Connection retry: connectionRetry [ sfs2x.client.SmartFox@41f6321]
[TEST] getReconnectionSeconds(): 60
56351 [Timer-1] ERROR sfs2x.client.core.sockets.TCPSocketLayer - TCPSocketLayer: Socket error: null
56351 [Timer-1] INFO sfs2x.client.core.EventDispatcher - Dispatching event OnError to 1 listeners
56351 [Timer-1] INFO sfs2x.client.core.EventDispatcher - Dispatching event ioError to 1 listenersThen I plug the cable back in, but nothing happens. If I try to do something I get the following error:
Code: Select all
70287 [AWT-EventQueue-0] WARN sfs2x.client.SmartFox - You are not connected. Request cannot be sent: sfs2x.client.requests.ExtensionRequest@889ec59I also noticed that it's dispatching an event on 'OnDisconnect', but I don't seem to get this (even though I listen to CONNECTION_LOST).
The same happens with our Flash client (although there I do get the CONNECTION_LOST event triggered, slightly after the CONNECTION_RETRY event is triggered).
Am I doing something wrong? Or is there are bug in the client libraries?
(I already made sure both client libraries are the latest from the download page)