Class WebSocketClient
public abstract class WebSocketClient : IDisposable
- Inheritance
-
WebSocketClient
- Implements
- Derived
- Inherited Members
Properties
Latency
public TimeSpan Latency { get; }
Property Value
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
WebSocketCloseStatusThe status to close with.
statusDescription
stringThe status description to close with.
cancellationToken
CancellationTokenThe cancellation token.
Returns
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
WebSocketPayloadPropertiescancellationToken
CancellationToken
Returns
Events
Close
public event Func<ValueTask>? Close
Event Type
Connect
public event Func<ValueTask>? Connect
Event Type
Connecting
public event Func<ValueTask>? Connecting
Event Type
Disconnect
public event Func<bool, ValueTask>? Disconnect
Event Type
LatencyUpdate
public event Func<TimeSpan, ValueTask>? LatencyUpdate
Event Type
Log
public event Func<LogMessage, ValueTask>? Log
Event Type
Resume
public event Func<ValueTask>? Resume