System.Net.HttpConnection.BeginReadRequest C# (CSharp) Method

BeginReadRequest() public method

public BeginReadRequest ( ) : void
return void
		public void BeginReadRequest ()
		{
			if (buffer == null)
				buffer = new byte [BufferSize];
			try {
				stream.BeginRead (buffer, 0, BufferSize, OnRead, this);
			} catch {
				CloseSocket ();
			}
		}

Usage Example

Esempio n. 1
0
        private static void ProcessAccept(SocketAsyncEventArgs args)
        {
            Socket accepted = null;

            if (args.SocketError == SocketError.Success)
            {
                accepted = args.AcceptSocket;
            }

            var epl = (EndPointListener)args.UserToken;


            Accept(epl._sock, args, ref accepted);
            if (accepted == null)
            {
                return;
            }

            if (epl._secure && epl._cert == null)
            {
                accepted.Dispose();
                return;
            }
            var conn = new HttpConnection(accepted, epl, epl._secure, epl._cert);

            lock (epl._unregistered)
            {
                epl._unregistered[conn] = conn;
            }
            conn.BeginReadRequest();
        }
All Usage Examples Of System.Net.HttpConnection::BeginReadRequest