SFSEventType.USER_DISCONNECT is not firing event handler

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

Moderators: Lapo, Bax

arvind
Posts: 34
Joined: 09 Jul 2013, 16:59

Re: SFSEventType.USER_DISCONNECT is not firing event handler

Post by arvind »

Hi Lapo,

Thanks for your feedback.
I test the application with above given instruction. I check the KillConnection(), retry and resume feature in the application, it was working fine.
To test those feature, I created an extension which send me private and public message respectively after an interval of 6 seconds. And in client side after receiving private or public message I call KillConnection() after 15 sec.
Application receive public and private messages after 6 sec and KillConnection() also work. I also test the application by unplugging the LAN wire to test hrc+ and I receive the messages but if I unplugged the cable for long time then I receive the "Connection Retry!!!" message and sample application freeze and I don't receive any further messages from SmartFox and also not any message of disconnection or connection lost.
SmartFoxConnection.zip
Here I attached my client and server side code for the application for better understanding
(13.6 KiB) Downloaded 669 times
Can you help us in this kind of situation.

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

Re: SFSEventType.USER_DISCONNECT is not firing event handler

Post by Lapo »

Didn't I mention that unplugging the ethernet cable won't work? :shock:
Lapo
--
gotoAndPlay()
...addicted to flash games
arvind
Posts: 34
Joined: 09 Jul 2013, 16:59

Re: SFSEventType.USER_DISCONNECT is not firing event handler

Post by arvind »

Hi Lapo,

Sorry, I guess I was not able to express myself properly. :(
Actually I want to check the response of the smartfoxserver if we loose the internet connection for longer time, then how the application behave and how the messages will send to the client application.
In order to check the above scenario, If we use the killConnection() method then it retry and resume the connection at instant so I am not able to test the scenario where we loose the connection for long period of time.

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

Re: SFSEventType.USER_DISCONNECT is not firing event handler

Post by Lapo »

Then shut down your internet connection instead of pulling the network plug. If you are running a modem or router shut it off and back on at a later time.
Lapo
--
gotoAndPlay()
...addicted to flash games
arvind
Posts: 34
Joined: 09 Jul 2013, 16:59

Re: SFSEventType.USER_DISCONNECT is not firing event handler

Post by arvind »

Hi Lapo,

Merry Xmas !!!!
Recently I faced a problem in connection like I establish the connection with smartfox and handle all event like retry, resume and lost connection.
Suddenly someone by-mistake restarted the server so because of that I got "Connection Retry" message but not able to get any further message from the SFS, that's why I am not able to show the user completely disconnected from the server as I am assuming connection can be resumed or lost because it is in connection retry phase.
Can we handle this kind of scenario in the application and how?

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

Re: SFSEventType.USER_DISCONNECT is not firing event handler

Post by Lapo »

Merry xmas to you too :)

No, if you turn off/restart the server no User will be able to reconnect because the entire state of the server is lost.
People will have to connect from scratch.

In any case the client should signal the DISCONNECT event, as far as I can remember. Just make sure you are using at least version 2.7 of the server.
Lapo
--
gotoAndPlay()
...addicted to flash games
arvind
Posts: 34
Joined: 09 Jul 2013, 16:59

Re: SFSEventType.USER_DISCONNECT is not firing event handler

Post by arvind »

Hello Lapo,

I am using the latest SFS 2.7x at my end but didn't receive the DISCONNECTION message if server restart.
I always get the RETRY message on server restart but no disconnection message that's why cleanup operation on DISCONNECTION at client side will not performed.

Thanks
Post Reply