Example #1
0
        public async Task ReadHandshakeAndSendResponseAsync()
        {
            await SentMessages.ReadAsync();

            var output = new MemoryStream();

            HandshakeProtocol.WriteResponseMessage(HandshakeResponseMessage.Empty, output);

            await _receivedMessages.Writer.WriteAsync(output.ToArray());
        }
Example #2
0
        public async Task <string> ReadSentTextMessageAsync()
        {
            var message = await SentMessages.ReadAsync();

            return(Encoding.UTF8.GetString(message));
        }