The WebSocket class allows applications to send and receive data after the WebSocket upgrade has completed.
Assembly: System (in System.dll)
Indicates the reason why the remote endpoint initiated the close handshake.
Allows the remote endpoint to describe the reason why the connection was closed.
Gets the default WebSocket protocol keep-alive interval in milliseconds.
Returns the current state of the WebSocket connection.
The subprotocol that was negotiated during the opening handshake.
Aborts the WebSocket connection and cancels any pending IO operations.
|CloseAsync(WebSocketCloseStatus, String, CancellationToken)|
Closes the WebSocket connection as an asynchronous operation using the close handshake defined in the WebSocket protocol specification section 7.
|CloseOutputAsync(WebSocketCloseStatus, String, CancellationToken)|
Initiates or completes the close handshake defined in the WebSocket protocol specification section 7.
Create client buffers to use with thisinstance.
|CreateClientWebSocket(Stream, String, Int32, Int32, TimeSpan, Boolean, ArraySegment<Byte>)|
This API supports the .NET Framework infrastructure and is not intended to be used directly from your code.
Allows callers to create a client side WebSocket class which will use the WSPC for framing purposes.
Creates a WebSocket server buffer.
Used to clean up unmanaged resources for ASP.NET and self-hosted implementations.
Determines whether the specified object is equal to the current object.(Inherited from Object.)
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.(Inherited from Object.)
Serves as the default hash function. (Inherited from Object.)
Obsolete. Returns a value that indicates if the WebSocket instance is targeting .NET Framework 4.5.
Returns a value that indicates if the state of the WebSocket instance is closed or aborted.
Receives data from theconnection asynchronously.
This API supports the .NET Framework infrastructure and is not intended to be used directly from your code. Allows callers to register prefixes for WebSocket requests (ws and wss).
|SendAsync(ArraySegment<Byte>, WebSocketMessageType, Boolean, CancellationToken)|
Sends data over theconnection asynchronously.
Verifies that the connection is in an expected state.
Returns a string that represents the current object.(Inherited from Object.)
Some of the classes in the System.Net.WebSockets namespace are supported on Windows 7, Windows Vista SP2, and Windows Server 2008. However, the only public implementations of client and server WebSockets are supported on Windows 8 and Windows Server 2012. The classes and class elements in the System.Net.WebSockets namespace that are supported on Windows 7, Windows Vista SP2, and Windows Server 2008 are abstract classes. This allows an application developer to inherit and extend these abstract classes with an actual implementation of client WebSockets.
Available since 4.5
Any public static ( Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.