Sequence of connection events 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

Sreelu
Posts: 22
Joined: 03 Oct 2016, 08:02

Sequence of connection events fired

Postby Sreelu » 17 Jan 2017, 13:17

I have some event handlers registered this way:
addEventHandler(SFSEventType.USER_DISCONNECT,OnPlayerGoneHandler.class);
addEventHandler(SFSEventType.USER_RECONNECTION_SUCCESS,OnPlayerReconnectionHandler.class);
addEventHandler(SFSEventType.USER_RECONNECTION_TRY,OnPlayerGoneHandler.class);

I understood that we shouldnot be testing scenarios by pulling out ethernet..But i got to implement a functionality which i need that to be done.

I have HRC in place..gave reconnection seconds of 15..When pulled out cable, no event is being fired at server side..but client side, observed tht reconnection try is being triggered..

Does server also gets the reconnection try event fired?(as of i understand it should be)
But Iam not getting the event to be fired!! and also when the user plugs in the cable, a disconnect event and then reconnection success event is being
triggered.
Could you please help me in understanding how to get either user disconnect event/retry event in this scenario??
User avatar
Lapo
Site Admin
Posts: 20837
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Sequence of connection events fired

Postby Lapo » 17 Jan 2017, 14:58

Sreelu wrote:I understood that we shouldnot be testing scenarios by pulling out ethernet..But i got to implement a functionality which i need that to be done.

If you unplug the ethernet cable (or turn off the WiFi) while the client is already connected you won't receive any event because your computer still thinks the connection is up. If you plug the ethernet cable back (before the TCP timeout) you will indeed be connected and able to communicate.

This has nothing to do with SmartFox, it's how TCP works.

We ha discussed this many times:
viewtopic.php?f=18&t=18224&p=79511
viewtopic.php?f=18&t=18743&p=81832

cheers
Lapo
--
gotoAndPlay()
...addicted to flash games

Return to “SFS2X Questions”

Who is online

Users browsing this forum: No registered users and 10 guests