ClientWebSocket Class
Provides a client for connecting to WebSocket services.
Assembly: System (in System.dll)
| Name | Description | |
|---|---|---|
![]() | ClientWebSocket() | Creates an instance of the ClientWebSocket class. |
| Name | Description | |
|---|---|---|
![]() | CloseStatus | Gets the reason why the close handshake was initiated on ClientWebSocket instance.(Overrides WebSocket::CloseStatus.) |
![]() | CloseStatusDescription | Gets a description of the reason why the ClientWebSocket instance was closed.(Overrides WebSocket::CloseStatusDescription.) |
![]() | Options | Gets the WebSocket options for the ClientWebSocket instance. |
![]() | State | Get the WebSocket state of the ClientWebSocket instance.(Overrides WebSocket::State.) |
![]() | SubProtocol | Gets the supported WebSocket sub-protocol for the ClientWebSocket instance.(Overrides WebSocket::SubProtocol.) |
| Name | Description | |
|---|---|---|
![]() | Abort() | Aborts the connection and cancels any pending IO operations.(Overrides WebSocket::Abort().) |
![]() | CloseAsync(WebSocketCloseStatus, String^, CancellationToken) | Close the ClientWebSocket instance as an asynchronous operation.(Overrides WebSocket::CloseAsync(WebSocketCloseStatus, String^, CancellationToken).) |
![]() | CloseOutputAsync(WebSocketCloseStatus, String^, CancellationToken) | Close the output for the ClientWebSocket instance as an asynchronous operation.(Overrides WebSocket::CloseOutputAsync(WebSocketCloseStatus, String^, CancellationToken).) |
![]() | ConnectAsync(Uri^, CancellationToken) | Connect to a WebSocket server as an asynchronous operation. |
![]() | Dispose() | Releases the unmanaged resources used by the ClientWebSocket instance.(Overrides WebSocket::Dispose().) |
![]() | Equals(Object^) | Determines whether the specified object is equal to the current object.(Inherited from Object.) |
![]() | GetHashCode() | Serves as the default hash function. (Inherited from Object.) |
![]() | GetType() | |
![]() | ReceiveAsync(ArraySegment<Byte>, CancellationToken) | Receive data on ClientWebSocket as an asynchronous operation.(Overrides WebSocket::ReceiveAsync(ArraySegment<Byte>, CancellationToken).) |
![]() | SendAsync(ArraySegment<Byte>, WebSocketMessageType, Boolean, CancellationToken) | Send data on ClientWebSocket as an asynchronous operation.(Overrides WebSocket::SendAsync(ArraySegment<Byte>, WebSocketMessageType, Boolean, CancellationToken).) |
![]() | ToString() | Returns a string that represents the current object.(Inherited from Object.) |
Some of the classes and class elements 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 class elements in the System.Net.WebSockets namespace that are supported on Windows 7, Windows Vista SP2, and Windows Server 2008 are abstract class elements. This allows an application developer to inherit and extend these abstract class classes and class elements 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.

