Session auto removed after about 1 minute of user inactivity when using a web service vpn connection

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
dekii
Posts: 6
Joined: 02 Oct 2024, 08:46

Session auto removed after about 1 minute of user inactivity when using a web service vpn connection

Post by dekii »

Session auto removed after about 1 minute of user inactivity when using a web service vpn connection
i only got this problem when client using connection ws with vpn, when turn off vpn it's not. i had config Session maximum idle time to 999 and
User maximum idle time to 9999 and Overridden user maximum idle time to 9999. I user sfs2x version
User avatar
Lapo
Site Admin
Posts: 23438
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Session auto removed after about 1 minute of user inactivity when using a web service vpn connection

Post by Lapo »

Hi,
the server never disconnects a client before the timeout, however a client can disconnect from it's side, for example when there are network issues, slowness, congestion etc...

It is highly likely that the VPN is causing the disconnection. A way to mitigate this issue is to send small packets every few seconds to keep the connection alive.
The client API provide a LagMonitor utility that sends ping requests every few seconds, to measure the latency with the server. You can turn it on from the client side and use this feature as a keep-alive mechanism.

For example in C# you can do this:

Code: Select all

sfs.EnableLagMonitor(true);

where sfs is an instance of the SmartFox class.

The same can be done in the other supported languages.

Cheers
Lapo
--
gotoAndPlay()
...addicted to flash games
dekii
Posts: 6
Joined: 02 Oct 2024, 08:46

Re: Session auto removed after about 1 minute of user inactivity when using a web service vpn connection

Post by dekii »

Lapo wrote:Hi,
the server never disconnects a client before the timeout, however a client can disconnect from it's side, for example when there are network issues, slowness, congestion etc...

It is highly likely that the VPN is causing the disconnection. A way to mitigate this issue is to send small packets every few seconds to keep the connection alive.
The client API provide a LagMonitor utility that sends ping requests every few seconds, to measure the latency with the server. You can turn it on from the client side and use this feature as a keep-alive mechanism.

For example in C# you can do this:

Code: Select all

sfs.EnableLagMonitor(true);

where sfs is an instance of the SmartFox class.

The same can be done in the other supported languages.

Cheers


Thanks for your reply, I just discovered that the port was disconnected right after the user joined the zone , and then connection lost maybe because limit reconnect failse. and i see a case is with another vpn, i cant connect. Maybe because vpn, i has no idea
Last edited by dekii on 08 Oct 2024, 08:30, edited 1 time in total.
dekii
Posts: 6
Joined: 02 Oct 2024, 08:46

Re: Session auto removed after about 1 minute of user inactivity when using a web service vpn connection

Post by dekii »

Is anyone having the same vpn connection problem as me? The problem is still not resolved :( :(
User avatar
Lapo
Site Admin
Posts: 23438
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Session auto removed after about 1 minute of user inactivity when using a web service vpn connection

Post by Lapo »

For further testing, I have checked the the IP address you have show in your screenshots and it works correctly. We can reach the websocket port and connect, also from a VPN.

This seems to confirm the hypothesis that the issue is the VPN you're using.
Cheers
Lapo
--
gotoAndPlay()
...addicted to flash games
dekii
Posts: 6
Joined: 02 Oct 2024, 08:46

Re: Session auto removed after about 1 minute of user inactivity when using a web service vpn connection

Post by dekii »

Thanks for your support :)
Post Reply