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