Export (0) Print
Expand All

ClientWebSocket Class

.NET Framework 4.5

Provides a client for connecting to WebSocket services.

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

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

public sealed class ClientWebSocket : WebSocket

The ClientWebSocket type exposes the following members.

  NameDescription
Public methodClientWebSocketCreates an instance of the ClientWebSocket class.
Top

  NameDescription
Public propertyCloseStatusGets the reason why the close handshake was initiated on ClientWebSocket instance. (Overrides WebSocket.CloseStatus.)
Public propertyCloseStatusDescriptionGets a description of the reason why the ClientWebSocket instance was closed. (Overrides WebSocket.CloseStatusDescription.)
Public propertyOptionsGets the WebSocket options for the ClientWebSocket instance.
Public propertyStateGet the WebSocket state of the ClientWebSocket instance. (Overrides WebSocket.State.)
Public propertySubProtocolGets the supported WebSocket sub-protocol for the ClientWebSocket instance. (Overrides WebSocket.SubProtocol.)
Top

  NameDescription
Public methodAbortAborts the connection and cancels any pending IO operations. (Overrides WebSocket.Abort().)
Public methodCloseAsyncClose the ClientWebSocket instance as an asynchronous operation. (Overrides WebSocket.CloseAsync(WebSocketCloseStatus, String, CancellationToken).)
Public methodCloseOutputAsyncClose the output for the ClientWebSocket instance as an asynchronous operation. (Overrides WebSocket.CloseOutputAsync(WebSocketCloseStatus, String, CancellationToken).)
Public methodConnectAsyncConnect to a WebSocket server as an asynchronous operation.
Public methodDisposeReleases the unmanaged resources used by the ClientWebSocket instance. (Overrides WebSocket.Dispose().)
Public methodEquals(Object)Determines whether the specified object is equal to the current object. (Inherited from Object.)
Public methodGetHashCodeServes as the default hash function. (Inherited from Object.)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Public methodReceiveAsyncReceive data on ClientWebSocket as an asynchronous operation. (Overrides WebSocket.ReceiveAsync(ArraySegment<Byte>, CancellationToken).)
Public methodSendAsyncSend data on ClientWebSocket as an asynchronous operation. (Overrides WebSocket.SendAsync(ArraySegment<Byte>, WebSocketMessageType, Boolean, CancellationToken).)
Public methodToStringReturns a string that represents the current object. (Inherited from Object.)
Top

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.

.NET Framework

Supported in: 4.5.2, 4.5.1, 4.5

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Show:
© 2014 Microsoft