Hi All,
Currently, I catch the message ( userLost, userExit, ..) from server to check whether user connection lost but It didn't work as I wish.
example, when the user unplug the network cable, I want the server could detect its event and fire it through handleInternalEvent ( or something like that) (like the way player.io do).
I just want someone who could confirm me whether I could do it. or I should send a message frequently ( eg. a message for every 10s).
Thanks.
How to detect client connection from server
This is detected by 'UserLost' internal event.
However, when an abrupt disconnection had occurred (such as unplugging the network cable or closing down the browser), it can take time for the server to detect this as it depends on the client. It is known to be more common with IE.
Shortening the MaxUserIdleTime can reduce the delay of detecting connection lost - but would mean you'll have to send a empty message to the server more often to avoid disconnection.
This have been discussed quite a bit before, so I'd recommend using the Search tool to find some further information about this.
However, when an abrupt disconnection had occurred (such as unplugging the network cable or closing down the browser), it can take time for the server to detect this as it depends on the client. It is known to be more common with IE.
Shortening the MaxUserIdleTime can reduce the delay of detecting connection lost - but would mean you'll have to send a empty message to the server more often to avoid disconnection.
This have been discussed quite a bit before, so I'd recommend using the Search tool to find some further information about this.
Smartfox's forum is my daily newspaper.