ProcessNextCommand() public method

public ProcessNextCommand ( ) : void
return void
        private void BeginAcceptTcpClientCallback(IAsyncResult ar)
        {
            try
            {
                var client = listener.EndAcceptTcpClient(ar);
                Interlocked.Increment(ref concurrentConnection);
                // accept additional connections
                listener.BeginAcceptTcpClient(BeginAcceptTcpClientCallback, null);

                var clientConnection = new ClientConnection(client, client.GetStream(), ()=>Interlocked.Decrement(ref concurrentConnection));
                clientConnection.ProcessNextCommand();
            }
            catch (ObjectDisposedException)
            {
            }
        }
Ejemplo n.º 2
0
        private void BeginAcceptTcpClientCallback(IAsyncResult ar)
        {
            try
            {
                var client = listener.EndAcceptTcpClient(ar);
                Interlocked.Increment(ref concurrentConnection);
                // accept additional connections
                listener.BeginAcceptTcpClient(BeginAcceptTcpClientCallback, null);

                var clientConnection = new ClientConnection(client, client.GetStream(), () => Interlocked.Decrement(ref concurrentConnection));
                clientConnection.ProcessNextCommand();
            }
            catch (ObjectDisposedException)
            {
            }
        }