protected IAsyncResult BeginWrite(byte[] buffer, int offset, int count, AsyncCallback callback, object state)
 {
     if (UseTls && SocketHell.FakeAsyncWriteWithDelegate)
     {
         _currentWriteOperation = new MonoBeginWriteDelegate(this.CurrentStream.Write);
         return(_currentWriteOperation.BeginInvoke(buffer, offset, count, callback, state));
     }
     else
     {
         return(this.CurrentStream.BeginWrite(buffer, offset, count, callback, state));
     }
 }
 protected void EndWrite(IAsyncResult asyncResult)
 {
     if (UseTls && SocketHell.FakeAsyncWriteWithDelegate)
     {
         try
         {
             _currentWriteOperation.EndInvoke(asyncResult);
         }
         finally
         {
             _currentWriteOperation = null;
         }
     }
     else
     {
         this.CurrentStream.EndWrite(asyncResult);
     }
 }
Example #3
0
		protected void EndWrite(IAsyncResult asyncResult)
		{
			if (UseTls && SocketHell.FakeAsyncWriteWithDelegate)
			{
				try
				{
					_currentWriteOperation.EndInvoke(asyncResult);
				}
				finally
				{
					_currentWriteOperation = null;
				}
			}
			else
			{
				this.CurrentStream.EndWrite(asyncResult);
			}
		}
Example #4
0
		protected IAsyncResult BeginWrite(byte[] buffer, int offset, int count, AsyncCallback callback, object state)
		{
			if (UseTls && SocketHell.FakeAsyncWriteWithDelegate)
			{
				_currentWriteOperation = new MonoBeginWriteDelegate(this.CurrentStream.Write);
				return _currentWriteOperation.BeginInvoke(buffer, offset, count, callback, state);
			}
			else
			{
				return this.CurrentStream.BeginWrite(buffer, offset, count, callback, state);
			}
		}