Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Repeatedly unable to reconnect to server after disconnection #643

Open
JohannesMP opened this issue Jan 23, 2014 · 2 comments
Open

Repeatedly unable to reconnect to server after disconnection #643

JohannesMP opened this issue Jan 23, 2014 · 2 comments
Labels
Milestone

Comments

@JohannesMP
Copy link

While not easily reproducible, I've had this occur several times now, where I am connected to a server, Disconnect (intentionally), and then attempting to reconnect results in the following output on the server, all within a split second:

[22:15:15] [Info] : New client...
[22:15:15] [Info] : Client TCP connection established...
[22:15:15] [Info] : Accepted client from 127.0.0.1:56771. Handshaking...
[22:15:15] [Info] : Johannes (#1) has joined the server using client version 0.1.5.1
[22:15:15] [Info] : Player #1 Johannes has disconnected: Connection lost

The few times that I've had this, someone else has been connected to the server as well, be it another user or another local client of mine. In these cases this also generally tends to 2-5 times in a row, where clicking connect will just result in the immediate 'connection lost' message on the server. After several attempts the next attempt will suddenly work like normal.

You can find the Relevant Client and Server Logs for a session that had this issue here. This is from a quick test session with a Friend of mine that lives a few miles away.

@JohannesMP
Copy link
Author

Was finally able to catch this with -kmpdebug on, while using the Profiling server build and LogLevel set to Debug

The error message in Player.log seems to be:

[Debug] : Connecting to IPv6: [::0.0.0.1]:2076

[Debug] : Exception thrown in connectionLoop(), catch 2, Exception: System.Net.Sockets.SocketException:     Connection refused
  at System.Net.Sockets.Socket.Connect (System.Net.EndPoint remoteEP, Boolean requireSocketPolicy) [0x00000] in <filename unknown>:0 
  at System.Net.Sockets.Socket.Connect (System.Net.EndPoint remoteEP) [0x00000] in <filename unknown>:0 
  at System.Net.Sockets.TcpClient.Connect (System.Net.IPEndPoint remote_end_point) [0x00000] in <filename unknown>:0 
  at KMP.KMPClientMain.connectionLoop () [0x00000] in <filename unknown>:0 

While on the server I see the following:

[02:06:15] [Debug] : Caught IOException for player client_1 in asyncReceive

The entire log can be accessed here - I failed to connect once, after which I was able to connect successfully, and said "ok, that was one failed connection" in chat as soon as I was logged in, so that should help you pinpoint the disconnect a few seconds earlier.

@godarklight
Copy link
Collaborator

The first error message is fully expected, it tries IPv6 first, instantly fails because of connection refused and falls back to IPv4.

Both part of your logs look like this: http://pastebin.com/bMbHv7P7

That IOException is interesting, It's probably the client closing the socket (I'm not sure why yet but it's something to go on).

@TehGimp TehGimp modified the milestones: v0.1.7, v0.1.6 Mar 12, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants