Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
ValueWebSocketReceiveResult.cs
Go to the documentation of this file.
2
3public readonly struct ValueWebSocketReceiveResult
4{
5 private readonly uint _countAndEndOfMessage;
6
8
9 public int Count => (int)(_countAndEndOfMessage & 0x7FFFFFFF);
10
11 public bool EndOfMessage => (_countAndEndOfMessage & 0x80000000u) == 2147483648u;
12
14
15 public ValueWebSocketReceiveResult(int count, WebSocketMessageType messageType, bool endOfMessage)
16 {
17 if (count < 0)
18 {
20 }
21 if ((uint)messageType > 2u)
22 {
24 }
25 _countAndEndOfMessage = (uint)count | (endOfMessage ? 2147483648u : 0u);
26 _messageType = messageType;
27 }
28
29 private static void ThrowCountOutOfRange()
30 {
31 throw new ArgumentOutOfRangeException("count");
32 }
33
34 private static void ThrowMessageTypeOutOfRange()
35 {
36 throw new ArgumentOutOfRangeException("messageType");
37 }
38}
ValueWebSocketReceiveResult(int count, WebSocketMessageType messageType, bool endOfMessage)