client disconnections via SFS

Need help with SmartFoxServer? You didn't find an answer in our documentation? Please, post your questions here!

Moderators: Lapo, Bax

Post Reply
shaih
Posts: 7
Joined: 18 Aug 2010, 18:54

client disconnections via SFS

Post by shaih »

Hi,

We have a SmartFox server and Flex based clients that randomly disconnect from the SmartFox Server. In the SmartFox Server log we just see user [xxx] was removed. the clients start disconnecting a few minutes after they connect to the SFS server.

We are using Flex client API and SFS 1.6.6. WE also tried pinging the SFS every 5 seconds using the roundtrip check to try and keep the tcp connection open.

Config file is standard with minimal changes, we got the same behavior on a Linux installation and a Windows one.

Please advise

Thanks
Shai
mrnothersan
Posts: 226
Joined: 24 Jan 2010, 18:38

Re: client disconnections via SFS

Post by mrnothersan »

shaih wrote:Hi,

We have a SmartFox server and Flex based clients that randomly disconnect from the SmartFox Server. In the SmartFox Server log we just see user [xxx] was removed. the clients start disconnecting a few minutes after they connect to the SFS server.

We are using Flex client API and SFS 1.6.6. WE also tried pinging the SFS every 5 seconds using the roundtrip check to try and keep the tcp connection open.

Config file is standard with minimal changes, we got the same behavior on a Linux installation and a Windows one.

Please advise

Thanks
Shai
Have you tried downloading 1.6.8?
shaih
Posts: 7
Joined: 18 Aug 2010, 18:54

updated the server with 1.6.9

Post by shaih »

I still need to apply 1.6.9 to flash client side, but updating the server only did not solve the problem.

What is the best way to keep the TCP connection open, are there any recommendations?

Thanks
BigFIsh
Posts: 1698
Joined: 25 Feb 2008, 19:26
Location: New Zealand

Post by BigFIsh »

What is the 'actual' message (related to users getting removed) you're seeing in your SmartFoxServer log?
Smartfox's forum is my daily newspaper.
shaih
Posts: 7
Joined: 18 Aug 2010, 18:54

Post by shaih »

The message I get is:

User [ USER_NAME] removed

We also ran test as follows:
Setting the idle time out to 60 seconds
connect with a client that will send a message to himself every 30 seconds

We assumed the message will start calculating the idle timeout with each message (since the user was not idle anymore)

But the SFS still disconnects the user.

Can you please help

Thanks
Shai
BigFIsh
Posts: 1698
Joined: 25 Feb 2008, 19:26
Location: New Zealand

Post by BigFIsh »

Which idle time are you setting?

There are two different types of idle times:

MaxUserIdleTime (this is for users who are logged in)
MaxSocketIdleTime (this is for users who aren't logged in)
Smartfox's forum is my daily newspaper.
shaih
Posts: 7
Joined: 18 Aug 2010, 18:54

Post by shaih »

both set for 1 hour, 3600 seconds
Gaurav
Posts: 24
Joined: 19 Apr 2010, 07:09

Post by Gaurav »

Hello,


In the java we do it like mentioned below

Code: Select all

//here u is the object of the user

u.updateMessageTime();

To make the connection opened we send the message from client to server and server execute the above code and make the connection alive..
Hope it helps.. :roll:
Sappho
Posts: 74
Joined: 29 Mar 2009, 19:23
Location: Slovakia

Re: client disconnections via SFS

Post by Sappho »

shaih wrote:We are using Flex client API and SFS 1.6.6. WE also tried pinging the SFS every 5 seconds using the roundtrip check to try and keep the tcp connection open.
The issue is right here, roundtrip check message doesn't restart the timer, you need to keep the connection alive using some other type of messages for example using extension or public message.
shaih
Posts: 7
Joined: 18 Aug 2010, 18:54

Post by shaih »

We also tried sending a message to self every x seconds, this seemed to have the same effect on the idle time out. We have made a test where we changed the idle timeout to 2 min and sent a message to self every 30 seconds. After 2 minutes the user was thrown from SFS.

Another one we saw was that some times SFS just kicks some users and we couldn't find the reason (might be network issues) but it happened in our internal LAN and in another environment as well.

Is there a way to find out why the socket disconnected? any logs or any suggestions would be appreciated (SFS logs are set to FINEST, no reason in the log for the disconnection)

Thanks
Sappho
Posts: 74
Joined: 29 Mar 2009, 19:23
Location: Slovakia

Post by Sappho »

I just tried simple client which sends constant string private message to myself in a minute interval while the idle timeout is set to 5 minutes. And it does work quite well when i checked i was still online after an hour.

As far as i know there is no way you can detect what was the issue for a particular user disconnection. Just look for other clues such as # of dropped messages which are the most common.
User avatar
Lapo
Site Admin
Posts: 23438
Joined: 21 Mar 2005, 09:50
Location: Italy

Post by Lapo »

A few quick tips:
1) The best way to keep a connection alive is to ping the server every 30-60 seconds sending an empty
2) (Optional) It is a very good a idea to keep the <MaxIdleSocketTime> to a low value, ideally < 60 seconds.

If you keep seeing the problem then you should look somewhere else for the cause. It could be a client connection problem or a generic network problem.
We have also seen a few rare cases in which it was the hosting provider itself having network stability issues.
Lapo
--
gotoAndPlay()
...addicted to flash games
Post Reply