diff --git a/HTTP.Example/Program.cs b/HTTP.Example/Program.cs index 2416ff4..7e79017 100644 --- a/HTTP.Example/Program.cs +++ b/HTTP.Example/Program.cs @@ -104,12 +104,13 @@ static class Program static async Task HandleWebsocket(Websocket ws) { - DataFrame payload = await ws.Read(); + TimeSpan timeout = TimeSpan.FromMinutes(1); + DataFrame payload = await ws.Read().WaitAsync(timeout); if (payload.Opcode != WSOpcode.Close) { string result = payload.AsString(); - await ws.Write($"Echoing message: \"{result}\""); + await ws.Write($"Echoing message: \"{result}\"").WaitAsync(timeout); } return CloseStatus.NormalClosure;