Unable to Kick 'already connected' client; User not timing out.
JohannesMP opened this issue ยท 2 comments
During a testing session with some friends, I got disconnected and upon trying to connect I got the standard Handshake failure: Client already connected
message
On the server console I tried to use the /kick
command to kick this 'ghost'. while it says Kicking User from the server
, when checking with /listclients
the client had not been kicked, and I still could not connect:
Am I wrong in assuming that it would make sense for /kick
to remove a player that is incorrectly marked as being connected?
Also why is the unconnected user not timing out? I ended up trying again 10 minutes later and according to the server the user was -still- logged in, despite the fact that my client was not able to connect.
edit: it finally timed out:
[13:13:48][INFO] : Client JohannesMP disconnected in Send Callback, endpoint 62.78.251.110:57191, error: EndWrite failure (Connection timed out)
I really think 15 minutes is far too long of a timeout. the server should know within less than 30 seconds if it hasn't heard anything from a given client.
This is weird. Checking the code, the player was supposed to be disconnected after 20 seconds without sending a heartbeat to the server.
private static void CheckHeartBeat(ClientObject client)
{
long currentTime = Server.serverClock.ElapsedMilliseconds;
if ((currentTime - client.lastReceiveTime) > Common.CONNECTION_TIMEOUT)
{
//Heartbeat timeout
DarkLog.Normal("Disconnecting client " + client.playerName + ", endpoint " + client.endpoint + ", Connection timed out");
DisconnectClient(client);
}
else
{
if (client.sendMessageQueueHigh.Count == 0 && client.sendMessageQueueSplit.Count == 0 && client.sendMessageQueueLow.Count == 0)
{
if ((currentTime - client.lastSendTime) > Common.HEART_BEAT_INTERVAL)
{
SendHeartBeat(client);
}
}
}
}