SFSEventType.USER_DISCONNECT not being fired

Post here your questions about SFS2X. Here we discuss all server-side matters. For client API questions see the dedicated forums.

Moderators: Lapo, Bax

Post Reply
pankaj454k
Posts: 9
Joined: 25 Aug 2011, 08:25

SFSEventType.USER_DISCONNECT not being fired

Post by pankaj454k »

Hi,

I am facing a strange issue with SFSEventType.USER_DISCONNECT, it gets fired when I close my browser but it doesn't get into the handler when LAN cable is unplugged or network connection is disabled.

Please Help!

Regards,
Anupam
User avatar
Bax
Site Admin
Posts: 4626
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Re: SFSEventType.USER_DISCONNECT not being fired

Post by Bax »

When you close the browser, all the connections are correctly ended.
Instead when you abruptly unplug the cable or disable the network connection, the socket connection can't be terminated properly and SFS is not immediately aware that the client isn't there anymore.
The event will be fired later, when a timeout occurs at operating system level.
Paolo Bax
The SmartFoxServer Team
set_a
Posts: 16
Joined: 23 Feb 2012, 13:24

Re: SFSEventType.USER_DISCONNECT not being fired

Post by set_a »

Hi

Could you explain me

What kind of events order will be on the server and flash if there's set setting "User reconnection timeframe" = 3

USER_DISCONNECT
USER_RECONNECTION_TRY
USER_RECONNECTION_SUCCESS

user in room in time disconnect
USER_DISCONNECT and USER_LEAVE_ROOM or only USER_DISCONNECT

The event USER_LEAVE_ROOM is running only if user didn't join the room in the proper time?

if the user was the last in the room (the room should be removed if it is empty) and there was a remote Internet connection or the browser was crashed. The room will be deleted immediately or it wait of time set in setting "User reconnection timeframe"

Thanks
User avatar
Lapo
Site Admin
Posts: 23438
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: SFSEventType.USER_DISCONNECT not being fired

Post by Lapo »

When HRC is active and a user is disconnected you get the USER_RECONNECTION_TRY event (client and server)
If the client reconnects successfully you will get USER_RECONNECTION_SUCCESS otherwise a regular USER_DISCONNECT will be fired.
Lapo
--
gotoAndPlay()
...addicted to flash games
Post Reply