DarkRiftNetworking / DarkRift

DarkRift Networking by Unordinal
http://darkriftnetworking.com
Other
218 stars 67 forks source link

Client randomly disconnects without the server being notified #180

Open SixPathsLT opened 1 year ago

SixPathsLT commented 1 year ago

Quick Description

The client will randomly disconnect from the server with no errors and the server still thinks its connected to the client.

Explanation

The master server is on port 4296, which all clients connect to. Once the client finds a match, a new .exe instance is opened to run on the next available port: 4297 then the client connects to this game server as well to play the match.

After awhile, the client randomly disconnects from the instanced game server that is on port 4297 but is still connected to the master server on port 4296.

This usually happens if the device being used has a poor internet connection. I was able to reproduce this issue continuously by using a VPN but several players are facing this problem without any VPN.

frg-kova commented 1 year ago

I think I have fixed this in my PR. if I remember correctly if a bad disconnect occurs, bichannel listener on server didn't end up cleaning properly his side. From #160 "Guaranteed closed bi channel connection fix with socket close not to leave connection socket open and client in disconnected state."

SixPathsLT commented 1 year ago

This wouldn't sort out the fact that clients are randomly disconnecting to begin with, correct? As it makes DR un-useable for fast paced multiplayer games when players face a random disconnection in their games.

The server tick rate is 40hz, sending an average about 600 bytes per TCP message.

frg-kova commented 1 year ago

wouldn't fix disconnects, but you did mention that it only happens on poor internet connections - auto reconnects in the background would be something needed to be handled by the game I think

SixPathsLT commented 1 year ago

Hmm, thing is it happened to me as well when I use a VPN but on other multiplayer games, I myself don't disconnect using VPN which makes it certain its something in the DR netcode as other users of DR are also facing random disconnections.