Hello.
We are developing an application for Android and we have an issue with restoring connection after it is lost. Issues happen when user switches wi-fi off, how should we handle such case correctly? We need to keep user on server as long as possible.
Technically, device should move to mobile internet and connection should restore but it does not happen. We only see CONNECTION_RETRY event on client and nothing else happens.
When connection is restored, there is an exception on server: SessionReconnectionException: Session Reconnection failure. The passed Session is not managed by the ReconnectionManager: java.nio.channels.SocketChannel
Can you please advise.
Connection lost issue
Re: Connection lost issue
Hi,
when switching network it's not possible to maintain the same connection because physically the client is closing the old TCP connection and opening a new one from a different IP address.
Best idea in this case is to handle the system event notifying the network switch and manually start a new connection.
Cheers
when switching network it's not possible to maintain the same connection because physically the client is closing the old TCP connection and opening a new one from a different IP address.
Best idea in this case is to handle the system event notifying the network switch and manually start a new connection.
Cheers
Re: Connection lost issue
Why then CONNECTION_LOST does not work? I assume, it should work when "User reconnection timeframe" is over but it does not happpen. Also, is it possible to call killConnection() to make reconnect establish a new connection automatically? Or is it better to call disconnect and then connect?
Re: Connection lost issue
CONNECTION_LOST may or may not fire based on the conditions of the underlying TCP stack.
Try pulling the ethernet cable off of your network card and be prepare to be amazed... nothing happens, no app will react. (the same goes for wifi)
We have discussed it here a hundred times, so I am not going to repeat it, but you can check this resource:
https://superuser.com/questions/911808/ ... rnet-cable
Try pulling the ethernet cable off of your network card and be prepare to be amazed... nothing happens, no app will react. (the same goes for wifi)
We have discussed it here a hundred times, so I am not going to repeat it, but you can check this resource:
https://superuser.com/questions/911808/ ... rnet-cable
Who is online
Users browsing this forum: No registered users and 95 guests