public async Task ReadHandshakeAndSendResponseAsync() { await SentMessages.ReadAsync(); var output = new MemoryStream(); HandshakeProtocol.WriteResponseMessage(HandshakeResponseMessage.Empty, output); await _receivedMessages.Writer.WriteAsync(output.ToArray()); }
public async Task <string> ReadSentTextMessageAsync() { var message = await SentMessages.ReadAsync(); return(Encoding.UTF8.GetString(message)); }