Table of Contents

Class WebSocketClient

Namespace
NetCord.Gateway
Assembly
NetCord.dll
public abstract class WebSocketClient : IDisposable
Inheritance
WebSocketClient
Implements
Derived
Inherited Members

Properties

Latency

public TimeSpan Latency { get; }

Property Value

TimeSpan

Methods

Abort()

public void Abort()

CloseAsync(WebSocketCloseStatus, string?, CancellationToken)

Closes the WebSocketClient.

public Task CloseAsync(WebSocketCloseStatus status = WebSocketCloseStatus.NormalClosure, string? statusDescription = null, CancellationToken cancellationToken = default)

Parameters

status WebSocketCloseStatus

The status to close with.

statusDescription string

The status description to close with.

cancellationToken CancellationToken

The cancellation token.

Returns

Task

Dispose()

public void Dispose()

Dispose(bool)

protected virtual void Dispose(bool disposing)

Parameters

disposing bool

SendPayloadAsync(ReadOnlyMemory<byte>, WebSocketPayloadProperties?, CancellationToken)

public ValueTask SendPayloadAsync(ReadOnlyMemory<byte> buffer, WebSocketPayloadProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

buffer ReadOnlyMemory<byte>
properties WebSocketPayloadProperties
cancellationToken CancellationToken

Returns

ValueTask

Events

Close

public event Func<ValueTask>? Close

Event Type

Func<ValueTask>

Connect

public event Func<ValueTask>? Connect

Event Type

Func<ValueTask>

Connecting

public event Func<ValueTask>? Connecting

Event Type

Func<ValueTask>

Disconnect

public event Func<bool, ValueTask>? Disconnect

Event Type

Func<bool, ValueTask>

LatencyUpdate

public event Func<TimeSpan, ValueTask>? LatencyUpdate

Event Type

Func<TimeSpan, ValueTask>

Log

public event Func<LogMessage, ValueTask>? Log

Event Type

Func<LogMessage, ValueTask>

Resume

public event Func<ValueTask>? Resume

Event Type

Func<ValueTask>