Getting disconnected

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

Moderators: Lapo, Bax

gbarnes
Posts: 16
Joined: 08 Apr 2014, 13:12

Getting disconnected

Postby gbarnes » 08 Apr 2014, 15:20

Hello,

The login to the server works just fine. The players can see each others and can move for some seconds, but they are automatically disconnected by the server. This doesn't happen if I connect via 127.0.0.1.

Idle time shouldn't be a problem since I send new player positions in specific periods.
User avatar
Lapo
Site Admin
Posts: 23026
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Getting disconnected

Postby Lapo » 08 Apr 2014, 19:31

What is the reason of the disconnection at the client side? (there's a specific parameter that can be checked)
Also, what errors (if any) do you get on the server side? Did you check the log files?

thanks
Lapo
--
gotoAndPlay()
...addicted to flash games
gbarnes
Posts: 16
Joined: 08 Apr 2014, 13:12

Re: Getting disconnected

Postby gbarnes » 10 Apr 2014, 08:16

Hey,

thanks for your answer. I checked the log files and client response. It seems that the server doesn't notify the client about the disconnect. I don't receive any connection lost or logout event what so ever.

I noticed that I only get disconnected when I join with a second player. As long as I'm only logged in with one player everything works. I don't even receive a connection lost event whenever I shutdown the server.

All this works perfectly when I use 127.0.0.1.
User avatar
Lapo
Site Admin
Posts: 23026
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Getting disconnected

Postby Lapo » 10 Apr 2014, 08:27

In this case it's not the server that is not sending notifications. Those events are caused by the TCP layer at the OS level.
It sounds like you are having network issues. Is your live server running on a dedicated hosting?
Lapo

--

gotoAndPlay()

...addicted to flash games
gbarnes
Posts: 16
Joined: 08 Apr 2014, 13:12

Re: Getting disconnected

Postby gbarnes » 10 Apr 2014, 08:44

We're just trying to do some internal tests. So I started the server software on my computer. Afterwards I started two client instances (on the same machine) and used the LAN ip address 192.168.0.131 instead of 127.0.0.1.
User avatar
Lapo
Site Admin
Posts: 23026
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Getting disconnected

Postby Lapo » 10 Apr 2014, 09:03

Let me understand this better.
Are you running the test in the local network or are you exposing your PC to the internet and test from outside?

Thanks
Lapo

--

gotoAndPlay()

...addicted to flash games
gbarnes
Posts: 16
Joined: 08 Apr 2014, 13:12

Re: Getting disconnected

Postby gbarnes » 10 Apr 2014, 09:11

No currently I'm just testing locally. I could of course connect to the server from outside the company I want to.

I had some more tests: This time I installed the server on another pc which just runs the software and connected from my pc with two clients, but this results in the same behavior.

I hope this clarifies my approach.
User avatar
Lapo
Site Admin
Posts: 23026
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Getting disconnected

Postby Lapo » 10 Apr 2014, 09:21

Thanks.
I have no idea what might be going on. Surely this is not the expected behavior. My suspect is that you are running software firewalls on your PCs which are causing the issue.

Try this test:
- with the server running on your PC, open a Windows command prompt on another PC and telnet the server ( telnet <ip-addr> 9933 )
- you will see that the server outputs some log messages saying that a new connection has been established.
- now close the prompt window and check what happens on the server side: you should see a message saying that the session was removed

Let me know if the test works for you
Lapo

--

gotoAndPlay()

...addicted to flash games
gbarnes
Posts: 16
Joined: 08 Apr 2014, 13:12

Re: Getting disconnected

Postby gbarnes » 10 Apr 2014, 09:31

Thanks,

I tested your approach and it tells me that it can't connect to the host. Neither running the server on my machine nor on the other machine. However using localhost as host address works fine of course.
User avatar
Lapo
Site Admin
Posts: 23026
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Getting disconnected

Postby Lapo » 10 Apr 2014, 09:37

Then something is not right in your local setup.
Did you configure the server to listen on the 192.168.x.x address?

It sounds like your socket connection is failing but the client is able to reach the server via the BlueBox connection (HTTP tunnel). This would explain why you don't see a disconnection event. Via HTTP the disconnection event is fired usually after ~25-30 seconds of inactivity.
Lapo

--

gotoAndPlay()

...addicted to flash games
User avatar
Lapo
Site Admin
Posts: 23026
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Getting disconnected

Postby Lapo » 10 Apr 2014, 09:38

See the Post-installation Tasks here:
http://docs2x.smartfoxserver.com/Gettin ... stallation
Lapo

--

gotoAndPlay()

...addicted to flash games
gbarnes
Posts: 16
Joined: 08 Apr 2014, 13:12

Re: Getting disconnected

Postby gbarnes » 10 Apr 2014, 09:43

Thank you!

I finally got the problem. I'm stupid I forgot to set the Socket Connection adresses, of course! Everything works now.

Return to “SFS2X Questions”

Who is online

Users browsing this forum: No registered users and 93 guests