ClientWebSocket ClientWebSocket ClientWebSocket ClientWebSocket Class

Definition

Provides a client for connecting to WebSocket services.

public ref class ClientWebSocket : System::Net::WebSockets::WebSocket, IDisposable
public class ClientWebSocket : System.Net.WebSockets.WebSocket, IDisposable
type ClientWebSocket = class
    inherit WebSocket
    interface IDisposable
Public Class ClientWebSocket
Inherits WebSocket
Implements IDisposable
Inheritance
ClientWebSocketClientWebSocketClientWebSocketClientWebSocket
Implements

Remarks

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.

Constructors

ClientWebSocket() ClientWebSocket() ClientWebSocket() ClientWebSocket()

Creates an instance of the ClientWebSocket class.

Properties

CloseStatus CloseStatus CloseStatus CloseStatus

Gets the reason why the close handshake was initiated on ClientWebSocket instance.

CloseStatusDescription CloseStatusDescription CloseStatusDescription CloseStatusDescription

Gets a description of the reason why the ClientWebSocket instance was closed.

Options Options Options Options

Gets the WebSocket options for the ClientWebSocket instance.

State State State State

Gets the WebSocket state of the ClientWebSocket instance.

SubProtocol SubProtocol SubProtocol SubProtocol

Gets the supported WebSocket sub-protocol for the ClientWebSocket instance.

Methods

Abort() Abort() Abort() Abort()

Aborts the connection and cancels any pending IO operations.

CloseAsync(WebSocketCloseStatus, String, CancellationToken) CloseAsync(WebSocketCloseStatus, String, CancellationToken) CloseAsync(WebSocketCloseStatus, String, CancellationToken) CloseAsync(WebSocketCloseStatus, String, CancellationToken)

Close the ClientWebSocket instance as an asynchronous operation.

CloseOutputAsync(WebSocketCloseStatus, String, CancellationToken) CloseOutputAsync(WebSocketCloseStatus, String, CancellationToken) CloseOutputAsync(WebSocketCloseStatus, String, CancellationToken) CloseOutputAsync(WebSocketCloseStatus, String, CancellationToken)

Close the output for the ClientWebSocket instance as an asynchronous operation.

ConnectAsync(Uri, CancellationToken) ConnectAsync(Uri, CancellationToken) ConnectAsync(Uri, CancellationToken) ConnectAsync(Uri, CancellationToken)

Connect to a WebSocket server as an asynchronous operation.

Dispose() Dispose() Dispose() Dispose()

Releases the unmanaged resources used by the ClientWebSocket instance.

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetHashCode() GetHashCode() GetHashCode() GetHashCode()

Serves as the default hash function.

(Inherited from Object)
GetType() GetType() GetType() GetType()

Gets the Type of the current instance.

(Inherited from Object)
MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
ReceiveAsync(ArraySegment<Byte>, CancellationToken) ReceiveAsync(ArraySegment<Byte>, CancellationToken) ReceiveAsync(ArraySegment<Byte>, CancellationToken) ReceiveAsync(ArraySegment<Byte>, CancellationToken)

Receives data on ClientWebSocket as an asynchronous operation.

ReceiveAsync(Memory<Byte>, CancellationToken) ReceiveAsync(Memory<Byte>, CancellationToken) ReceiveAsync(Memory<Byte>, CancellationToken) ReceiveAsync(Memory<Byte>, CancellationToken)
SendAsync(ArraySegment<Byte>, WebSocketMessageType, Boolean, CancellationToken) SendAsync(ArraySegment<Byte>, WebSocketMessageType, Boolean, CancellationToken) SendAsync(ArraySegment<Byte>, WebSocketMessageType, Boolean, CancellationToken) SendAsync(ArraySegment<Byte>, WebSocketMessageType, Boolean, CancellationToken)

Send data on ClientWebSocket as an asynchronous operation.

SendAsync(ReadOnlyMemory<Byte>, WebSocketMessageType, Boolean, CancellationToken) SendAsync(ReadOnlyMemory<Byte>, WebSocketMessageType, Boolean, CancellationToken) SendAsync(ReadOnlyMemory<Byte>, WebSocketMessageType, Boolean, CancellationToken) SendAsync(ReadOnlyMemory<Byte>, WebSocketMessageType, Boolean, CancellationToken)
ToString() ToString() ToString() ToString()

Returns a string that represents the current object.

(Inherited from Object)

Applies to