///////////////////////////////////////////////////////////////////////////////////////////
 /// <summary>
 /// Accepts a new client connection
 /// </summary>
 /// <param name="result">The object containing information about the new connection</param>
 ///////////////////////////////////////////////////////////////////////////////////////////
 protected override void OnSocketException(TCPSocket socket, SocketExceptionEventArgs args)
 {
     if (args.Exception.ErrorCode == (int)SocketError.ConnectionReset) {
         if (args.RemoteEndPoint != null)
             this[args.RemoteEndPoint].Disconnect(); //Connection thread will remove it
     }
     base.OnSocketException(socket, args);
 }
 ///////////////////////////////////////////////////////////////////////////////////////////
 /// <summary>
 /// Handles the ConnectionReset socket error
 /// </summary>
 ///////////////////////////////////////////////////////////////////////////////////////////
 protected override void OnSocketException(TCPSocket socket, SocketExceptionEventArgs args)
 {
     if (args.Exception.ErrorCode == (int)SocketError.ConnectionReset) {
         Disconnect();
     }
     base.OnSocketException(socket, args);
 }
 protected override void OnSocketException(TCPSocket socket, SocketExceptionEventArgs args)
 {
     if ((args.Exception.ErrorCode == 10054) || (args.Exception.ErrorCode == 10053))
     {
         base.Disconnect();
     }
 }
 protected virtual void OnSocketException(TCPSocket socket, SocketExceptionEventArgs args)
 {
     if(SocketException != null) SocketException(socket, args);
 }