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); }
public static SocketContext StartConnectAsync(AwaitableSignal awaitableSignal, Socket socket, EndPoint remoteEndPoint) { return(new SocketContext(awaitableSignal, socket, remoteEndPoint)); }