Server fails to remove user when ethernet unplugged
Server fails to remove user when ethernet unplugged
I have a weird bug. I have apps on iPhones connecting. The get all the normal events fired. The userlist works fine and updates when I quit the app on any phone. All working as expected. However, these phones are connected via ethernet dongles. If I pull the plug on any dongle, the app immediately triggers onConnectionLost and I see that in the app. But the server never removes that user. And if I try to log in again on that app, the server refuses that connection because of a duplicate user name. Any input on this? Is there a setting in the server config to lower the amount of time the server hangs on to users? I see no errors on the server other than duplicate username refused. Server is on MacOSX, current build 2.17.3 with objective-c api 1.7.12. Thanks in advance.
Re: Server fails to remove user when ethernet unplugged
Hi,
pulling the plugs doesn't allow the disconnection to complete. Because a TCP disconnection requires an exchange of messages between client and server, pulling the plug physically prevents it.
For more details we have an in depth article on this topic, here:
https://smartfoxserver.com/blog/what-re ... tworkwifi/
Also this might interest you:
https://smartfoxserver.com/blog/handlin ... e-devices/
Cheers
pulling the plugs doesn't allow the disconnection to complete. Because a TCP disconnection requires an exchange of messages between client and server, pulling the plug physically prevents it.
For more details we have an in depth article on this topic, here:
https://smartfoxserver.com/blog/what-re ... tworkwifi/
Also this might interest you:
https://smartfoxserver.com/blog/handlin ... e-devices/
Cheers
Re: Server fails to remove user when ethernet unplugged
Is it possible to write an extension such:
User would log in through the extension
Extension would check for duplicate username in the userlist
If the duplicate existed, it would disconnect that user
It would then log in current user
Thanks for all your help
User would log in through the extension
Extension would check for duplicate username in the userlist
If the duplicate existed, it would disconnect that user
It would then log in current user
Thanks for all your help
Re: Server fails to remove user when ethernet unplugged
Hi,
this mechanism already exists. The server does exactly the same thing if your turn on the forceLogout option in your Zone.
However this will not work very reliably with the use case you have described (pulling the ethernet cable), because of the reason I already explained. If you physically remove the cable the disconnection will not be acknowledged by the server because they parties cannot send messages to each other.
Therefore the only way out is to wait TCP timeout that will trigger on the server side, evenutally.
Cheers
this mechanism already exists. The server does exactly the same thing if your turn on the forceLogout option in your Zone.
However this will not work very reliably with the use case you have described (pulling the ethernet cable), because of the reason I already explained. If you physically remove the cable the disconnection will not be acknowledged by the server because they parties cannot send messages to each other.
Therefore the only way out is to wait TCP timeout that will trigger on the server side, evenutally.
Cheers
Who is online
Users browsing this forum: No registered users and 78 guests