예제 #1
0
 /// <inheritdoc />
 public Task CloseAsync(CancellationToken ct) =>
 SystemWebSocket.CloseAsync(WebSocketCloseStatus.NormalClosure, string.Empty, ct);
예제 #2
0
 /// <inheritdoc />
 void IDisposable.Dispose() => SystemWebSocket?.Dispose();
예제 #3
0
 /// <inheritdoc />
 public Task SendAsync(byte[] buffer, bool isText, CancellationToken ct)
 => SystemWebSocket.SendAsync(
     new ArraySegment <byte>(buffer),
     isText ? WebSocketMessageType.Text : WebSocketMessageType.Binary,
     true,
     ct);
예제 #4
0
 /// <inheritdoc />
 public Task CloseAsync(Net.CloseStatusCode code, string comment = null, CancellationToken cancellationToken = default) =>
 SystemWebSocket.CloseAsync(MapCloseStatus(code), comment ?? string.Empty, cancellationToken);