Client just return connection lost

Post here your questions about the Unity / .Net / Mono / Windows 8 / Windows Phone 8 API for SFS2X

Moderators: Lapo, Bax

Posts: 45
Joined: 01 Sep 2009, 13:26

Client just return connection lost

Postby kaligus » 04 Jan 2012, 18:02

Hello, long time no posting here, just getting back to SFS now :lol:

I downloaded the last SFS2X, the last tutorials and the last API.
I installed and put SFS up and running.

With the SFS2X-Connector example I'm able to connect, from same PC or other PC (even with MAC).
But, with all devices/PCs connected, everything got lost connection after a few seconds.

I tried to change the API, but same thing happens all the time.

Anyone experienced this already?

Thank you
Posts: 59
Joined: 28 Dec 2011, 22:52

Postby Jake-GR » 05 Jan 2012, 01:16

by default, the session timeout is set for 20 seconds, so if the client doesnt login to a zone or send some traffic, they will timeout.

also the error message will be "unknown" if the client is not logged in. if the client is logged into a zone when they timeout, there will be two connection lost events, one with "timeout" (for the zone) and another of "unknown" (for the server).
Posts: 45
Joined: 01 Sep 2009, 13:26

Postby kaligus » 05 Jan 2012, 11:25

Hey Jake, thanks for the reply.

For the SFS2X-Connector example I agree with you, but I ran the SFS2X-Lobby example and same thing happens, the user, even logged into a room (Simple Chat) got logged out a few seconds later.

I will try to change some points in the server (like sending variables, etc, make the client and server receive some packages) and I will see if this happens again.
Posts: 59
Joined: 28 Dec 2011, 22:52

Postby Jake-GR » 05 Jan 2012, 18:58

Just curious, are you using RC3 for the server, and using the updated client API?

I ran the lobby example (swapping out the client api with rc3) locally, remotely on my laptop, and remotely on dedicated server, and clients stayed logged in for 5min (before getting timedout)
Posts: 45
Joined: 01 Sep 2009, 13:26

Postby kaligus » 05 Jan 2012, 19:04

Hey Jake,

I was just about to post...
I made another test, with the Lobby example... If I keep sending messages (or any kind of package) it stays logged in with no problem.
After a few moments, it logs out. Maybe it was really because of the Timeout timer, but I'm not sure because I did not count anything.

But, also, If I just log in into a room and send no text message (chat), the player logs out with less than 5 minutes (not respecting the server configuration). Looks like to me that I need to keep sending messages every a few seconds to keep the player/user logged.

I'm using the SFS2X lastest (SFS2X-RC1) with the latest API.
EDIT: but I patched for RC3 :lol:
Posts: 1297
Joined: 14 Mar 2008, 07:52
Location: Sweden

Postby ThomasLund » 10 Jan 2012, 10:47

Is there possibly some networking equipment, firewalls or something else between you and the server?

Full Control - maker of Unity/C# and Java SFS API and indie games
Follow on twitter:
Posts: 45
Joined: 01 Sep 2009, 13:26

Postby kaligus » 10 Jan 2012, 11:32

Hey Thomas,

I was travelling yesterday so no time to post, because I found the problem.
If I keep the focus in Unity the connection time to disconnect works with no problems. When Unity lost the focus then this happens.

For now I keep unity sending some small message packs to sfs server, then it stays logged all the time. That worked for me and I even created already a server side extension to work with this.

Thank you everyone for the help

Return to “SFS2X C# API”

Who is online

Users browsing this forum: No registered users and 2 guests