コード例 #1
0
 ///////////////////////////////////////////////////////////////////////////////////////////
 /// <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);
 }
コード例 #2
0
 ///////////////////////////////////////////////////////////////////////////////////////////
 /// <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);
 }
コード例 #3
0
 protected override void OnSocketException(TCPSocket socket, SocketExceptionEventArgs args)
 {
     if ((args.Exception.ErrorCode == 10054) || (args.Exception.ErrorCode == 10053))
     {
         base.Disconnect();
     }
 }
コード例 #4
0
 protected virtual void OnSocketException(TCPSocket socket, SocketExceptionEventArgs args)
 {
     if(SocketException != null) SocketException(socket, args);
 }