Esempio n. 1
0
        protected IAsyncResult BeginRead(byte[] buffer, int offset, int count, AsyncCallback callback, object state)
        {
            if (UseTls && SocketHell.FakeAsyncReadWithDelegate)
            {
                _currentReadOperation = new MonoBeginReadDelegate(this.CurrentStream.Read);

                return(_currentReadOperation.BeginInvoke(buffer, offset, count, callback, state));
            }
            else
            {
                return(this.CurrentStream.BeginRead(buffer, offset, count, callback, state));
            }
        }
Esempio n. 2
0
        protected int EndRead(IAsyncResult asyncResult)
        {
            if (UseTls && SocketHell.FakeAsyncReadWithDelegate)
            {
                int result;
                try
                {
                    result = _currentReadOperation.EndInvoke(asyncResult);
                }
                finally
                {
                    _currentReadOperation = null;
                }

                return(result);
            }
            else
            {
                return(this.CurrentStream.EndRead(asyncResult));
            }
        }
Esempio n. 3
0
		protected int EndRead(IAsyncResult asyncResult)
		{
			if (UseTls && SocketHell.FakeAsyncReadWithDelegate)
			{
				int result;
				try
				{
					result = _currentReadOperation.EndInvoke(asyncResult);
				}
				finally
				{
					_currentReadOperation = null;
				}

				return result;
			}
			else
			{
				return this.CurrentStream.EndRead(asyncResult);
			}
		}
Esempio n. 4
0
		protected IAsyncResult BeginRead(byte[] buffer, int offset, int count, AsyncCallback callback, object state)
		{
			if (UseTls && SocketHell.FakeAsyncReadWithDelegate)
			{

				_currentReadOperation = new MonoBeginReadDelegate(this.CurrentStream.Read);

				return _currentReadOperation.BeginInvoke(buffer, offset, count, callback, state);
			}
			else
			{
				return this.CurrentStream.BeginRead(buffer, offset, count, callback, state);
			}
		}