<PackageReference Include="NETStandard.Library" Version="2.0.3" />

System.Net.WebSockets.WebSocket

public abstract class WebSocket : IDisposable
namespace System.Net.WebSockets { public abstract class WebSocket : IDisposable { public abstract WebSocketCloseStatus? CloseStatus { get; } public abstract string CloseStatusDescription { get; } public static TimeSpan DefaultKeepAliveInterval { get; } public abstract WebSocketState State { get; } public abstract string SubProtocol { get; } protected WebSocket(); public abstract void Abort(); public abstract Task CloseAsync(WebSocketCloseStatus closeStatus, string statusDescription, CancellationToken cancellationToken); public abstract Task CloseOutputAsync(WebSocketCloseStatus closeStatus, string statusDescription, CancellationToken cancellationToken); public static ArraySegment<byte> CreateClientBuffer(int receiveBufferSize, int sendBufferSize); public static WebSocket CreateClientWebSocket(Stream innerStream, string subProtocol, int receiveBufferSize, int sendBufferSize, TimeSpan keepAliveInterval, bool useZeroMaskingKey, ArraySegment<byte> internalBuffer); public static ArraySegment<byte> CreateServerBuffer(int receiveBufferSize); public abstract void Dispose(); protected static bool IsStateTerminal(WebSocketState state); public abstract Task<WebSocketReceiveResult> ReceiveAsync(ArraySegment<byte> buffer, CancellationToken cancellationToken); public static void RegisterPrefixes(); public abstract Task SendAsync(ArraySegment<byte> buffer, WebSocketMessageType messageType, bool endOfMessage, CancellationToken cancellationToken); protected static void ThrowOnInvalidState(WebSocketState state, params WebSocketState[] validStates); } }