user is disconnected after 5 minuites logged in (idle)

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

Moderators: Lapo, Bax

ducbot
Posts: 6
Joined: 23 Apr 2018, 09:16

user is disconnected after 5 minuites logged in (idle)

Postby ducbot » 10 May 2018, 06:47

Hi Smartfoxserver Team,

I tried to change the "user maximum idle time" to 3000 seconds (both in server configuration and Zone configuration)

However, after logged into Zone, the user is disconnected after next 5 minuites.

How can I extends this idle time ?

13:24:06,082 INFO [SFSWorker:Ext:2] api.SFSApi - User login: { Zone: OnlineGame }, ( User Name: ducbot, Id: 1, Priv: 0, Sess: 127.0.0.1:51087 ) , Type: Unity
13:29:06,092 INFO [Scheduler-412111214] sessions.DefaultSessionManager - Session removed: { Id: 3, Type: WEBSOCKET, Logged: Yes, IP: 127.0.0.1:51087 }
13:29:06,096 INFO [SFSWorker:Sys:1] api.SFSApi - User disconnected: { Zone: OnlineGame }, ( User Name: ducbot, Id: 1, Priv: 0, Sess: 127.0.0.1:51087 ) , SessionLen: 300014, Type: Unity

Thank you.
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: user is disconnected after 5 minuites logged in (idle)

Postby Lapo » 10 May 2018, 08:20

Hi,
in the logs there is no evidence that the server disconnected the client. When it happens the server logs a specific message, saying that the client was disconnected because it was idle for too long.

You can also double check that by printing out the disconnection reason in the SFSEvent.CONNECTION_LOST. If it says "unknown" then the disconnection was not initiated by the server.

Given you're testing in a local network it's likely that the browser dropped the connection after a while. To avoid it you can keep it alive with by sending a "signal" every once in a while. This can be done, for example, by activating the LagMonitor in the API which calculates the lag between client and server by sending a "ping pong" request every few seconds.
( see here: https://smartfoxserver.com/blog/the-imp ... ing-times/ )

Otherwise you can make a custom "ping pong" request by sending an empty Extension request (ping) and replying with an empty response (pong).

Hope it helps
Lapo
--
gotoAndPlay()
...addicted to flash games

Return to “SFS2X Questions”

Who is online

Users browsing this forum: No registered users and 72 guests