Table of Contents

Class WebSocketClient

Namespace
DisCatSharp.Net.WebSocket
Assembly
DisCatSharp.dll

The default, native-based WebSocket client implementation.

public class WebSocketClient : IWebSocketClient, IDisposable
Inheritance
WebSocketClient
Implements
Inherited Members

Properties

DefaultHeaders

Gets the collection of default headers to send when connecting to the remote endpoint.

Proxy

Gets the proxy settings for this client.

Methods

AddDefaultHeader(string, string)

Adds a header to the default header collection.

ConnectAsync(Uri)

Connects to a specified remote WebSocket endpoint.

CreateNew(IWebProxy, IServiceProvider)

Creates a new instance of WebSocketClient.

DisconnectAsync(int, string?)

Disconnects the WebSocket connection.

Dispose()

Disposes of resources used by this WebSocket client instance.

RemoveDefaultHeader(string)

Removes a header from the default header collection.

SendMessageAsync(string)

Send a message to the WebSocket server.

Events

Connected

Triggered when the client connects successfully.

Disconnected

Triggered when the client is disconnected.

ExceptionThrown

Triggered when an error occurs in the client.

MessageReceived

Triggered when the client receives a message from the remote party.

Explicit Interface Implementations

IWebSocketClient.ServiceProvider

Gets or sets the service provider.