Blue box disconnect

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
set_a
Posts: 16
Joined: 23 Feb 2012, 13:24

Blue box disconnect

Post by set_a »

Hello,

I have a question. How does Smartfox server know that user disconnected from the server if user was connected via bluebox, not usual connection?

Thanks in avdvance
User avatar
rjgtav
Posts: 2813
Joined: 19 Apr 2009, 11:31
Location: Lisbon, Portugal

Re: Blue box disconnect

Post by rjgtav »

Hi.
When you get the USER_DISCONNECT event on the extension, one of its parameters is the SFSEventParam.USER, which is the User object of that user who just disconnected.
In an User object, you have the getSession() method, which returns an instance of the Session object.
In this Session object, you have a method called getType() which returns an instance of the SessionType enum.
This enum tells you whether that user was connected via socket or via BlueBox.
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.
User avatar
Lapo
Site Admin
Posts: 23438
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Blue box disconnect

Post by Lapo »

set_a wrote:Hello,

I have a question. How does Smartfox server know that user disconnected from the server if user was connected via bluebox, not usual connection?
The client pings the server every once in a while, if the ping doesn't get to the server the user is considered disconnected after an amount of time. This is why you don't get a real-time notification of the user's disconnection, it usually takes 25-30 seconds before the timeout mechanism kicks in.

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