public Disconnect ( int code ) : void | ||
code | int | /// The disconnect code. If set to 9, the OnDisconect event will not be called, the database /// will not be updated to reset everyone's session code, and the EventArgs objects will NOT /// be returned to the IO pool. You should only set to 9 for a planned server shutdown. /// |
return | void |
/// <summary> /// Checks the timeout on a client connection. This method is used to detect hanging connections, and /// forcefully disconnects them. /// </summary> /// <param name="client"></param> 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 L.LogError("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); } }
/// <summary> /// Checks the timeout on a client connection. This method is used to detect hanging connections, and /// forcefully disconnects them. /// </summary> /// <param name="client"></param> 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); } }