microsoft/teams.net
Publicmirrored fromhttps://github.com/microsoft/teams.netAvailable
Libraries/Microsoft.Teams.Plugins/Microsoft.Teams.Plugins.AspNetCore.DevTools/Extensions/WebSocket.cs
17lines · modecode
| 1 | // Copyright (c) Microsoft Corporation. All rights reserved. |
| 2 | // Licensed under the MIT License. |
| 3 | |
| 4 | using System.Net.WebSockets; |
| 5 | |
| 6 | namespace Microsoft.Teams.Plugins.AspNetCore.DevTools.Extensions; |
| 7 | |
| 8 | public static class WebSocketExtensions |
| 9 | { |
| 10 | public static bool IsCloseable(this WebSocket socket) |
| 11 | { |
| 12 | return ( |
| 13 | socket.State != WebSocketState.Closed && |
| 14 | socket.State != WebSocketState.Aborted |
| 15 | ); |
| 16 | } |
| 17 | } |