Skip to content

Commit eabedfe

Browse files
committed
📝 Minor improvement to server-side example
1 parent 8e671fe commit eabedfe

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

src/WebSocketChannel/readme.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,11 @@ app.Use(async (context, next) =>
5252
}
5353
catch (OperationCanceledException)
5454
{
55-
await webSocket.CloseOutputAsync(WebSocketCloseStatus.NormalClosure, null, default);
55+
try
56+
{
57+
await webSocket.CloseOutputAsync(WebSocketCloseStatus.NormalClosure, null, default);
58+
}
59+
catch { } // Best effort to try closing cleanly. Client may be entirely gone.
5660
}
5761
}
5862
else
@@ -69,6 +73,7 @@ app.Use(async (context, next) =>
6973

7074

7175

76+
7277
## Sponsors
7378

7479
[![sponsored](https://raw.githubusercontent.com/devlooped/oss/main/assets/images/sponsors.svg)](https://github.com/sponsors/devlooped) [![clarius](https://raw.githubusercontent.com/clarius/branding/main/logo/byclarius.svg)](https://github.com/clarius)[![clarius](https://raw.githubusercontent.com/clarius/branding/main/logo/logo.svg)](https://github.com/clarius)

0 commit comments

Comments
 (0)