예제 #1
0
        private SocketContext(AwaitableSignal awaitableSignal, Socket socket, EndPoint remoteEndPoint)
        {
            _socketAsyncEventArgs = new SocketAsyncEventArgs();
            _socketAsyncEventArgs.SetBuffer(Buffer, 0, 0);
            _socketAsyncEventArgs.Completed     += delegate { Complete(); };
            _socketAsyncEventArgs.RemoteEndPoint = remoteEndPoint;
            _awaitableSignal = awaitableSignal;
            _socket          = socket;

            StartSocketAction(_socket.ConnectAsync);
        }
예제 #2
0
 public static SocketContext StartConnectAsync(AwaitableSignal awaitableSignal, Socket socket, EndPoint remoteEndPoint)
 {
     return(new SocketContext(awaitableSignal, socket, remoteEndPoint));
 }