protected void CheckTimeout(GpcmClient client)
{
// Setup vars
DateTime expireTime = client.Created.AddSeconds(Timeout);
GpcmClient oldC;
// Remove all processing connections that are hanging
if (client.Status != LoginStatus.Completed && expireTime <= DateTime.Now)
{
try
{
client.Disconnect(1);
Processing.TryRemove(client.ConnectionId, out oldC);
}
catch (Exception ex)
{
// Log the error
Program.ErrorLog.Write(
"NOTICE: [GpcmServer.CheckTimeout] Error removing client from processing queue. Generating Excpetion Log"
);
ExceptionHandler.GenerateExceptionLog(ex);
}
}
else if (client.Status == LoginStatus.Completed)
{
Processing.TryRemove(client.ConnectionId, out oldC);
}
}