예제 #1
0
        public async Task SendHandshake(Stream stream, Handshake handshake)
        {
            byte[] handshakeResponse = handshake.ToArray();

            await stream.WriteAsync(handshakeResponse,
                                    0,
                                    handshakeResponse.Length)
            .ConfigureAwait(false);
        }
예제 #2
0
        public async Task SendHandshake(TcpClient client, Handshake handshake)
        {
            byte[] handshakeResponse = handshake.ToArray();

            await client.GetStream()
            .WriteAsync(handshakeResponse,
                        0,
                        handshakeResponse.Length)
            .ConfigureAwait(false);
        }