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