Ejemplo n.º 1
0
 ///<summary>Called when there's an incoming connection in the AcceptSocket queue.</summary>
 ///<param name="ar">The result of the asynchronous operation.</param>
 protected override async Task OnAccept(SocketConnection socket)
 {
     AcceptSocket.Dispose();
     AcceptSocket = null;
     if (RemoteBindIP.Equals(((IPEndPoint)RemoteConnection.RemoteEndPoint).Address))
     {
         await Dispose(ReplyCode.RequestGranted);
     }
     else
     {
         await Dispose(ReplyCode.RequestRejected1);
     }
 }
Ejemplo n.º 2
0
 ///<summary>Called when there's an incoming connection in the AcceptSocket queue.</summary>
 ///<param name="ar">The result of the asynchronous operation.</param>
 protected override void OnAccept(IAsyncResult ar)
 {
     try {
         RemoteConnection = AcceptSocket.EndAccept(ar);
         AcceptSocket.Close();
         AcceptSocket = null;
         if (RemoteBindIP.Equals(((IPEndPoint)RemoteConnection.RemoteEndPoint).Address))
         {
             Dispose(90);
         }
         else
         {
             Dispose(91);
         }
     } catch {
         Dispose(91);
     }
 }