Inheritance: StateObject
示例#1
0
        private void AcceptCallback(IAsyncResult asyncResult)
        {
            if (!KeepGoing)
                return;

            Signal.Set();
            var boundSocket = (Socket)asyncResult.AsyncState;
            var receivingSocket = boundSocket.EndAccept(asyncResult);
            var state = new TcpState(receivingSocket);
            state.BeginReceive(ReadCallback);
        }
示例#2
0
        private void AcceptCallback(IAsyncResult asyncResult)
        {
            if (!KeepGoing)
            {
                return;
            }

            signal.Set();
            var boundSocket     = (Socket)asyncResult.AsyncState;
            var receivingSocket = boundSocket.EndAccept(asyncResult);
            var state           = new TcpState(receivingSocket);

            state.BeginReceive(ReadCallback);
        }