ClientWebSocket Class

ClientWebSocket Class

.NET Framework (current version)
 

Provides a client for connecting to WebSocket services.

Namespace:   System.Net.WebSockets
Assembly:  System (in System.dll)

System.Object
  System.Net.WebSockets.WebSocket
    System.Net.WebSockets.ClientWebSocket

public sealed class ClientWebSocket : WebSocket

NameDescription
System_CAPS_pubmethodClientWebSocket()

Creates an instance of the ClientWebSocket class.

NameDescription
System_CAPS_pubpropertyCloseStatus

Gets the reason why the close handshake was initiated on ClientWebSocket instance.(Overrides WebSocket.CloseStatus.)

System_CAPS_pubpropertyCloseStatusDescription

Gets a description of the reason why the ClientWebSocket instance was closed.(Overrides WebSocket.CloseStatusDescription.)

System_CAPS_pubpropertyOptions

Gets the WebSocket options for the ClientWebSocket instance.

System_CAPS_pubpropertyState

Get the WebSocket state of the ClientWebSocket instance.(Overrides WebSocket.State.)

System_CAPS_pubpropertySubProtocol

Gets the supported WebSocket sub-protocol for the ClientWebSocket instance.(Overrides WebSocket.SubProtocol.)

NameDescription
System_CAPS_pubmethodAbort()

Aborts the connection and cancels any pending IO operations.(Overrides WebSocket.Abort().)

System_CAPS_pubmethodCloseAsync(WebSocketCloseStatus, String, CancellationToken)

Close the ClientWebSocket instance as an asynchronous operation.(Overrides WebSocket.CloseAsync(WebSocketCloseStatus, String, CancellationToken).)

System_CAPS_pubmethodCloseOutputAsync(WebSocketCloseStatus, String, CancellationToken)

Close the output for the ClientWebSocket instance as an asynchronous operation.(Overrides WebSocket.CloseOutputAsync(WebSocketCloseStatus, String, CancellationToken).)

System_CAPS_pubmethodConnectAsync(Uri, CancellationToken)

Connect to a WebSocket server as an asynchronous operation.

System_CAPS_pubmethodDispose()

Releases the unmanaged resources used by the ClientWebSocket instance.(Overrides WebSocket.Dispose().)

System_CAPS_pubmethodEquals(Object)

Determines whether the specified object is equal to the current object.(Inherited from Object.)

System_CAPS_pubmethodGetHashCode()

Serves as the default hash function. (Inherited from Object.)

System_CAPS_pubmethodGetType()

Gets the Type of the current instance.(Inherited from Object.)

System_CAPS_pubmethodReceiveAsync(ArraySegment<Byte>, CancellationToken)

Receive data on ClientWebSocket as an asynchronous operation.(Overrides WebSocket.ReceiveAsync(ArraySegment<Byte>, CancellationToken).)

System_CAPS_pubmethodSendAsync(ArraySegment<Byte>, WebSocketMessageType, Boolean, CancellationToken)

Send data on ClientWebSocket as an asynchronous operation.(Overrides WebSocket.SendAsync(ArraySegment<Byte>, WebSocketMessageType, Boolean, CancellationToken).)

System_CAPS_pubmethodToString()

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.

Universal Windows Platform
Available since 10
.NET Framework
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.

Return to top
Show:
© 2016 Microsoft