Example #1
0
 private void PipeRemoteReceiveCallback(IAsyncResult ar)
 {
     if (_closed)
     {
         return;
     }
     try
     {
         int bytesRead = _remote.EndReceive(ar);
         if (bytesRead > 0)
         {
             _local.BeginSend(remoteRecvBuffer, 0, bytesRead, 0, PipeConnectionSendCallback, null);
         }
         else
         {
             _local.Shutdown(SocketShutdown.Send);
             _localShutdown = true;
             CheckClose();
         }
     }
     catch (Exception e)
     {
         Logging.LogUsefulException(e);
         Close();
     }
 }
Example #2
0
 public int EndReceive(IAsyncResult asyncResult)
 {
     return(_remote.EndReceive(asyncResult));
 }