Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ GetMessageType()

static WebSocketMessageType System.Net.WebSockets.WebSocketBase.GetMessageType ( WebSocketProtocolComponent::BufferType bufferType)
inlinestaticprivate

Definition at line 1455 of file WebSocketBase.cs.

1456 {
1457 switch (bufferType)
1458 {
1459 case WebSocketProtocolComponent.BufferType.Close:
1460 return WebSocketMessageType.Close;
1461 case WebSocketProtocolComponent.BufferType.BinaryMessage:
1462 case WebSocketProtocolComponent.BufferType.BinaryFragment:
1463 return WebSocketMessageType.Binary;
1464 case WebSocketProtocolComponent.BufferType.UTF8Message:
1465 case WebSocketProtocolComponent.BufferType.UTF8Fragment:
1466 return WebSocketMessageType.Text;
1467 default:
1468 throw new WebSocketException(WebSocketError.NativeError, System.SR.Format(System.SR.net_WebSockets_InvalidBufferType, bufferType, WebSocketProtocolComponent.BufferType.Close, WebSocketProtocolComponent.BufferType.BinaryFragment, WebSocketProtocolComponent.BufferType.BinaryMessage, WebSocketProtocolComponent.BufferType.UTF8Fragment, WebSocketProtocolComponent.BufferType.UTF8Message));
1469 }
1470 }
static string Format(string resourceFormat, object p1)
Definition SR.cs:118
static string net_WebSockets_InvalidBufferType
Definition SR.cs:162
Definition SR.cs:7

References System.SR.Format(), and System.SR.net_WebSockets_InvalidBufferType.

Referenced by System.Net.WebSockets.WebSocketBase.WebSocketOperation.ReceiveOperation.ProcessAction_IndicateReceiveComplete().