Page 1 of 1
Blue box disconnect
Posted: 15 May 2012, 15:24
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
Re: Blue box disconnect
Posted: 15 May 2012, 20:13
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.
Re: Blue box disconnect
Posted: 16 May 2012, 12:52
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