37 references to MessageOpcode
System.Net.WebSockets (37)
System\Net\WebSockets\ManagedWebSocket.cs (32)
98
private MessageHeader _lastReceiveHeader = new MessageHeader { Opcode =
MessageOpcode
.Text, Fin = true, Processed = true };
341
MessageOpcode
opcode;
349
opcode =
MessageOpcode
.Continuation;
353
opcode = messageType == WebSocketMessageType.Binary ?
MessageOpcode
.Binary :
MessageOpcode
.Text;
484
private ValueTask SendFrameAsync(
MessageOpcode
opcode, bool endOfMessage, bool disableCompression, ReadOnlyMemory<byte> payloadBuffer, CancellationToken cancellationToken)
503
private ValueTask SendFrameLockAcquiredNonCancelableAsync(
MessageOpcode
opcode, bool endOfMessage, bool disableCompression, ReadOnlyMemory<byte> payloadBuffer)
605
private async ValueTask SendFrameFallbackAsync(
MessageOpcode
opcode, bool endOfMessage, bool disableCompression, ReadOnlyMemory<byte> payloadBuffer, Task lockTask, CancellationToken cancellationToken)
646
private int WriteFrameToSendBuffer(
MessageOpcode
opcode, bool endOfMessage, bool disableCompression, ReadOnlySpan<byte> payloadBuffer)
697
private static int WriteHeader(
MessageOpcode
opcode, byte[] sendBuffer, ReadOnlySpan<byte> payload, bool endOfMessage, bool useMask, bool compressed)
727
if (compressed && opcode !=
MessageOpcode
.Continuation)
875
if (header.Opcode ==
MessageOpcode
.Ping || header.Opcode ==
MessageOpcode
.Pong)
880
else if (header.Opcode ==
MessageOpcode
.Close)
887
if (header.Opcode ==
MessageOpcode
.Continuation)
894
Debug.Assert(header.Opcode ==
MessageOpcode
.Binary || header.Opcode ==
MessageOpcode
.Text, $"Unexpected opcode {header.Opcode}");
902
messageType: header.Opcode ==
MessageOpcode
.Text ? WebSocketMessageType.Text : WebSocketMessageType.Binary,
985
if (header.Opcode ==
MessageOpcode
.Text &&
999
header.Opcode ==
MessageOpcode
.Text ? WebSocketMessageType.Text : WebSocketMessageType.Binary,
1183
bool processPing = header.Opcode ==
MessageOpcode
.Ping;
1185
bool processPong = header.Opcode ==
MessageOpcode
.Pong && _keepAlivePingState is not null
1199
MessageOpcode
.Pong,
1306
header.Opcode = (
MessageOpcode
)(receiveBufferSpan[_receiveBufferOffset] & 0xF);
1364
case
MessageOpcode
.Continuation:
1383
case
MessageOpcode
.Binary:
1384
case
MessageOpcode
.Text:
1393
case
MessageOpcode
.Close:
1394
case
MessageOpcode
.Ping:
1395
case
MessageOpcode
.Pong:
1540
await SendFrameAsync(
MessageOpcode
.Close, endOfMessage: true, disableCompression: true, new Memory<byte>(buffer, 0, count), cancellationToken).ConfigureAwait(false);
1875
internal
MessageOpcode
Opcode;
System\Net\WebSockets\ManagedWebSocket.KeepAlive.cs (5)
33
TrySendKeepAliveFrameAsync(
MessageOpcode
.Pong));
36
private ValueTask TrySendKeepAliveFrameAsync(
MessageOpcode
opcode, ReadOnlyMemory<byte> payload = default)
38
Debug.Assert((opcode is
MessageOpcode
.Pong) || (!IsUnsolicitedPongKeepAlive && opcode is
MessageOpcode
.Ping));
120
await TrySendKeepAliveFrameAsync(
MessageOpcode
.Ping, pingPayloadBuffer).ConfigureAwait(false);