Random disconnection issues

  • Hi, I'm running a server on my linux box and I'm experiencing random disconnect issues with clients.


    Client log:

    Code
    java.net.SocketException: Connection reset
    at java.net.SocketInputStream.read(Unknown Source)
    at java.net.SocketInputStream.read(Unknown Source)
    at java.net.SocketInputStream.read(Unknown Source)
    at de.jiw.network.connector.tcp.TcpConnector.read(TcpConnector.java:170)
    at de.jiw.network.connector.ConnectorReadThread.run(ConnectorReadThread.java:67)


    On the server logs I don't see anything that would indicate any issues prior to these disconnects. All it says is that the remote host closed the connection. Due to the fact that the game sources are obfuscated and the trace doesn't really give any pointers where to look at, I couldn't debug this myself.

  • Basically the "Connection reset" just means that the connection has been closed unexpectedly. When does the issue occur exactly? Does it happen after a certain amount of time (e.g. after exactly 10 minutes)?
    What firewall and antivirus program do you use?

  • Basically the "Connection reset" just means that the connection has been closed unexpectedly. When does the issue occur exactly? Does it happen after a certain amount of time (e.g. after exactly 10 minutes)?
    What firewall and antivirus program do you use?


    It's not a firewall issue, it's most likely that the socket is being terminated when the client or server is reading or writing data incorrectly. There is no exact time for this happening, it's completely random with everyone who is connecting to the server having the same problem.


    EDIT: I'm gonna be looking more into this today when I get a chance to run through the code. So far we are loving the game, but this disconnection issue is starting to annoy people. Everything else on my box is running fine, all the other services are running smoothly, no problems at all.


    EDIT 2: Tested also without any firewalls with direct route to the host box, only a few routers between the two machines, same problem. This is not even a localized issue that could be explained by routing issues. Disconnection occurs after a few minutes, to even a maximum of 15 minutes. I'm also in the middle of reading through the strace output for the small test session I did where a client gets disconnected. After that I guess the only other option is to check the packet flow and check if there are any problems visible. The server says the connection was terminated by remote host (client), and the client says that the connection was reset.


    EDIT 3: Last data sent by client:

    Code
    \0\30@\33\0\0\1Q\361/P\375\0\0\1Q\361,\301\343\0\0\0\0\0\0


    EDIT 4: Every disconnection happens exactly after five minutes.

  • Thanks for your feedback and your effort to find the reason for the disconnect :)


    Tested also without any firewalls with direct route to the host box, only a few routers between the two machines, same problem. This is not even a localized issue that could be explained by routing issues.


    Usually your connection still passes several nodes until it "reaches" your server. If the connection reset occurs at a fixed interval, it's usually caused by one of the nodes. This problem occurs especially in combination with cable internet. Using a VPN service solves this issue in most cases, since your connection takes a different route then (and there is a high chance that the problematic node will be skipped). Basically you can find out if you have this issue (or if the connection reset is caused by something else) if you try to connect to a hive verified server: If you get a "No authentication possible" error, it's exactly this problem (since your hive connection - which works independent of your regular network connection - gets a "connection reset", too).


    Last data sent by client:


    Where did you pick this data? Basically just bytes were sent over the network, it seems that the program you were using to monitor the traffic converted it into a string? Unfortunately we can't do much with this string, since it's taken out of context :(

  • i just wanted to back red up here as i have been running a server for some time and have had lots of users come and go, what i have found out is most users on cable have disconnection problems its very common with cable.
    one of our users who was kicked every 5 to 10min in his router set the port forwarding of the ports of the server that means the serverport and 1 port down and 4 ports up to be forwarded to the local ip of his pc to port range 0 - 65000, or what ever port range you want this seems to have helped him heaps but not a complete fix,
    he can now stay ingame for hours but if he push's the windows home key to go out of the game, as soon as he goes to go back in the game it disconnects

    Yahgiggle Steam Signature, real name Deon Hamilton :thumbsup: Server @ ip 139.99.136.76:4255 Name (The Federation of territory) Unity :thumbsup:

    If at first your code does not work call it version 0.1 with the odd bug :thinking:

    My Own Website




    31245-logo-png
  • Thanks for your feedback and your effort to find the reason for the disconnect :)



    Usually your connection still passes several nodes until it "reaches" your server. If the connection reset occurs at a fixed interval, it's usually caused by one of the nodes. This problem occurs especially in combination with cable internet. Using a VPN service solves this issue in most cases, since your connection takes a different route then (and there is a high chance that the problematic node will be skipped). Basically you can find out if you have this issue (or if the connection reset is caused by something else) if you try to connect to a hive verified server: If you get a "No authentication possible" error, it's exactly this problem (since your hive connection - which works independent of your regular network connection - gets a "connection reset", too).



    Where did you pick this data? Basically just bytes were sent over the network, it seems that the program you were using to monitor the traffic converted it into a string? Unfortunately we can't do much with this string, since it's taken out of context :(


    I used strace to look up possible issues, also I tested with 5 nodes between the server and the client, still same issue, and those nodes are working as expected, no issues, the data center is very close to the machine I used to test this, it would take more effort to get a closer connection with only 1 node between.


    I do have the complete transaction logs of the data being sent and received by the server, but it is going to be in the same format.


    I was also asking a couple friends who have more experience with JVM and possible issues with networking, none of them were able to give anything of use that I didn't already try. A possible problem could be a faulty network driver on the machine that I am running the server on, but it seems unlikely and requires more effort then I'm willing to put in to actually get that tested.


    But in every other regard the game has been great.

Participate now!

Don’t have an account yet? Create a new account now and be part of our community!