userLost event

Post here your questions about Actionscript and Java server side extensions development.

Moderators: Lapo, Bax

Satyarth
Posts: 131
Joined: 06 Nov 2008, 12:45
Location: Delhi, India
Contact:

userLost event

Postby Satyarth » 29 Nov 2011, 04:47

I have noticed it couple of times before as well. But it is bothering me more now.

In couple of scenarios, ( e.g when i pull my lan cable ) , userLost is not received in server extension.

Is it known ? Are there any typical cases where it happens ? Any work around for it?
User avatar
Bax
Site Admin
Posts: 4609
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Re: userLost event

Postby Bax » 29 Nov 2011, 10:47

(use the forum search function!)

Lapo wrote:If you turn off your network abruptly (i.e. pull the plug) all your socket connections will remain open. No application (SFS included) will have a clue that the network is down. The reason is that TCP connections require a 4 way message transaction to disconnect, but if no network is available a proper disconnection will not occur. Hence no events.

The good news, however, is that when you plug the network again everything will keep working as if nothing has happened.
If you let too much time pass the OS might actually force all the connections to close if there's a timeout in the system (most OSes have one)
Paolo Bax
The SmartFoxServer Team
Satyarth
Posts: 131
Joined: 06 Nov 2008, 12:45
Location: Delhi, India
Contact:

userLost event

Postby Satyarth » 29 Nov 2011, 16:45

But the TCP will timeout eventually, right ? So when TCP times out, it should fire userLost . Please let me know if i am wrong.
User avatar
rjgtav
Posts: 2813
Joined: 19 Apr 2009, 11:31
Location: Lisbon, Portugal

Postby rjgtav » 29 Nov 2011, 18:31

Yes that's correct. You can also set the <DeadChannelsPolicy> setting in the config.xml file to 'strict', so it will remove most of these ghost connections quicker and throw the userLost event.
Skills: SFS Pro, SFS2X, AS2.0/AS3.0, Java, HTML5/CSS3/JS, C#
Portfolio: https://rjgtav.wordpress.com/
SFS Tutorials: http://sfs-tutor.blogspot.com/ - Discontinued. Some examples may be bugged.

Return to “Server Side Extension Development”

Who is online

Users browsing this forum: No registered users and 22 guests