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
Blue box disconnect
Re: Blue box disconnect
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.
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.
Portfolio: https://rjgtav.wordpress.com/
SFS Tutorials: http://sfs-tutor.blogspot.com/ - Discontinued. Some examples may be bugged.
Re: Blue box disconnect
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
Who is online
Users browsing this forum: No registered users and 104 guests