handling Session Reconnection failure
Posted: 08 Dec 2014, 18:54
Hi Lapo,
I'm using sfs2x v. 2.9.0 and connection IOS clients to it.
I am not very sure if the post is for the IOS section or the server one...
When I put my app in the background, and then open it again - how should I manage the session reconnection?
Should I listen to any events and do anything specific, or should i let it to the smartfoxClient to handle the reconnection on its own?
Right now I try to reconnect to the server and re-create the smarfoxClient object as suggested in this topic
http://forums.smartfoxserver.com/viewtopic.php?t=12552
But I get this issue:
look below this line
after it I put the app in the background and then bring it back.
I'm using sfs2x v. 2.9.0 and connection IOS clients to it.
I am not very sure if the post is for the IOS section or the server one...
When I put my app in the background, and then open it again - how should I manage the session reconnection?
Should I listen to any events and do anything specific, or should i let it to the smartfoxClient to handle the reconnection on its own?
Right now I try to reconnect to the server and re-create the smarfoxClient object as suggested in this topic
http://forums.smartfoxserver.com/viewtopic.php?t=12552
But I get this issue:
look below this line
Code: Select all
19:51:40,567 INFO [SFSWorker:Ext:4] Extensions - {ScavengerArenaExtension}: Skill played in [BotRoom7021] user [54831555d4c6fbedbbead85e] Power PunchCode: Select all
19:50:57,870 INFO [SFSWorker:Sys:1] v2.SmartFoxServer - SmartFoxServer 2X (2.9.0) READY!
19:50:59,585 INFO [main] v3.SessionFilter - BlueBox-2X Service (3.0.0) ready.
19:51:28,418 INFO [SocketReader] sessions.DefaultSessionManager - Session created: { Id: 1, Type: DEFAULT, Logged: No, IP: 192.168.0.101:57303 } on Server port: 9933 <---> 57303
19:51:28,439 INFO [SFSWorker:Ext:3] Extensions - {ScavengerArenaExtension}: user login with name(gcID) = G:1067204144
19:51:28,449 INFO [SFSWorker:Ext:3] api.SFSApi - User login: { Zone: ScavengerArena }, ( User Name: 54831555d4c6fbedbbead85e, Id: 0, Priv: 0, Sess: 192.168.0.101:57303 ) , Type: IOS version: 8.1.1
19:51:28,454 INFO [SFSWorker:Ext:4] Extensions - {ScavengerArenaExtension}: User joins zone u = 54831555d4c6fbedbbead85e; rating = 1000
19:51:28,456 INFO [SFSWorker:Ext:4] api.SFSApi - Room joined: [ Room: MainLobby, Id: 0, Group: default, isGame: false ], { Zone: ScavengerArena }, ( User Name: 54831555d4c6fbedbbead85e, Id: 0, Priv: 0, Sess: 192.168.0.101:57303 ) , asSpect: false
19:51:37,429 INFO [SFSWorker:Ext:1] managers.SFSRoomManager - Room created: { Zone: ScavengerArena }, [ Room: BotRoom7021, Id: 4, Group: default, isGame: true ]
19:51:37,431 INFO [SFSWorker:Ext:1] api.SFSApi - Room joined: [ Room: BotRoom7021, Id: 4, Group: default, isGame: true ], { Zone: ScavengerArena }, ( User Name: 54831555d4c6fbedbbead85e, Id: 0, Priv: 0, Sess: 192.168.0.101:57303 ) , asSpect: false
19:51:40,567 INFO [SFSWorker:Ext:4] Extensions - {ScavengerArenaExtension}: Skill played in [BotRoom7021] user [54831555d4c6fbedbbead85e] Power Punch
19:51:51,523 INFO [SocketReader] sessions.DefaultSessionManager - Session created: { Id: 2, Type: DEFAULT, Logged: No, IP: 192.168.0.101:57308 } on Server port: 9933 <---> 57308
19:51:51,531 INFO [SFSWorker:Ext:2] Extensions - {ScavengerArenaExtension}: user login with name(gcID) = G:1067204144
19:51:51,533 INFO [SFSWorker:Ext:2] scala.DefLI - User already logged in. Disconnecting previous instance : ( User Name: 54831555d4c6fbedbbead85e, Id: 0, Priv: 0, Sess: 192.168.0.101:57303 )
19:51:51,534 INFO [SFSWorker:Ext:2] sessions.DefaultSessionManager - Session removed: { Id: 1, Type: DEFAULT, Logged: Yes, IP: 192.168.0.101:57303 }
19:51:51,535 INFO [SFSWorker:Ext:2] managers.SFSRoomManager - Room removed: { Zone: ScavengerArena }, [ Room: BotRoom7021, Id: 4, Group: default, isGame: true ], Duration: 14107
19:51:51,536 INFO [SFSWorker:Ext:2] api.SFSApi - User disconnected: { Zone: ScavengerArena }, ( User Name: 54831555d4c6fbedbbead85e, Id: 0, Priv: 0, Sess: 192.168.0.101:57303 ) , SessionLen: 23087, Type: IOS version: 8.1.1
19:51:52,633 INFO [SocketReader] sessions.DefaultSessionManager - Session created: { Id: 3, Type: DEFAULT, Logged: No, IP: 192.168.0.101:57309 } on Server port: 9933 <---> 57309
SENDING TO -------> { Id: 3, Type: DEFAULT, Logged: No, IP: 192.168.0.101:57309 }
19:51:52,655 WARN [SFSWorker:Sys:4] v290.SystemReqController - com.smartfoxserver.bitswarm.exceptions.SessionReconnectionException: Session Reconnection failure. The passed Session is not managed by the ReconnectionManager: java.nio.channels.SocketChannel[connected local=/192.168.0.102:9933 remote=/192.168.0.101:57309]
com.smartfoxserver.bitswarm.sessions.DefaultReconnectionManager.reconnectSession(DefaultReconnectionManager.java:146)
com.smartfoxserver.bitswarm.sessions.DefaultSessionManager.reconnectSession(DefaultSessionManager.java:383)
com.smartfoxserver.v2.controllers.system.Handshake.execute(Handshake.java:68)
com.smartfoxserver.v2.controllers.v290.SystemReqController.processRequest(SystemReqController.java:157)
com.smartfoxserver.v2.controllers.v290.SystemReqController.enqueueRequest(SystemReqController.java:114)
com.smartfoxserver.bitswarm.io.protocols.AbstractProtocolCodec.dispatchRequestToController(AbstractProtocolCodec.java:39)
com.smartfoxserver.v2.protocol.SFSProtocolCodec.dispatchRequest(SFSProtocolCodec.java:125)
com.smartfoxserver.v2.protocol.SFSProtocolCodec.onPacketRead(SFSProtocolCodec.java:90)
com.smartfoxserver.v2.protocol.binary.BinaryIoHandler$1.run(BinaryIoHandler.java:525)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
java.lang.Thread.run(Thread.java:745)
19:51:52,666 INFO [SocketReader] sessions.DefaultSessionManager - Session removed: { Id: 3, Type: DEFAULT, Logged: No, IP: 192.168.0.101:57309 }