In case cases, Smartfoxserver doesn´t manage bad disconnection or abrupt disconnection.
Some or this cases are unplug network wire, some error in proxies or a device that is sharing 3g with other devices and loses mobile signal.
I understand that in some extreme cases socket protocol can not send a connection close to the extension so Sfs doesn´t know that the connection is lost. (I have read http://forums.smartfoxserver.com/viewto ... 7716#17716).
To prevent that situations, in some special rooms that is very important to avoid this issues we have created a scheduleAtFixedRate Task that sends a message to all user rooms and
if in the next iteration of the Schedule Task some user haven´t response we manually this connect that user from the server.
The problem comes when trying to Kick users that have lost connection abruptly server can´t disconnect them.
We have tried this actions:
- extension.sfsApi.kickUser(player, null,"Connection Lost Abruptly", 1);
- extension.sfsApi.disconnectUser(player);
- extension.sfsApi.disconnect(player.getSession());
- Manually kick user in the Admin Tool
After some some test, finally we could handle this by adding: extension.sfsApi.logout(player) before extension.sfsApi.kickUser(player, null,"Connection Lost Abruptly", 1);
Is this a bug on Smartfoxserver or are we using sfsApi in the wrong way? why have I to logout a user before disconnecting him?
It is important to us manage not standard disconnections in some cases. We are aware that unplug ethernet wire doesn´t happen often but sharing 3g connection via Smartphone or
mobile router is becoming relative often.
Thanks.