-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathuWebSocketConst.pas
65 lines (56 loc) · 2.27 KB
/
uWebSocketConst.pas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
unit uWebSocketConst;
interface
type
TWsOpcode = Int8;
TWsCloseCode = UInt16;
const
wsNoFrame = -1;
const
{:Constants section defining what kind of data are sent from one pont to another}
{:Continuation frame }
wsCodeContinuation = $0;
{:Text frame }
wsCodeText = $1;
{:Binary frame }
wsCodeBinary = $2;
{:Close frame }
wsCodeClose = $8;
{:Ping frame }
wsCodePing = $9;
{:Frame frame }
wsCodePong = $A;
{:Constants section defining close codes}
{:Normal valid closure, connection purpose was fulfilled}
wsCloseNormal = 1000;
{:Endpoint is going away (like server shutdown) }
wsCloseShutdown = 1001;
{:Protocol error }
wsCloseErrorProtocol = 1002;
{:Unknown frame data type or data type application cannot handle }
wsCloseErrorData = 1003;
{:Reserved }
wsCloseReserved1 = 1004;
{:Close received by peer but without any close code. This close code MUST NOT be sent by application. }
wsCloseNoStatus = 1005;
{:Abnotmal connection shutdown close code. This close code MUST NOT be sent by application. }
wsCloseErrorClose = 1006;
{:Received text data are not valid UTF-8. }
wsCloseErrorUTF8 = 1007;
{:Endpoint is terminating the connection because it has received a message that violates its policy. Generic error. }
wsCloseErrorPolicy = 1008;
{:Too large message received }
wsCloseTooLargeMessage = 1009;
{:Client is terminating the connection because it has expected the server to negotiate one or more extension, but the server didn't return them in the response message of the WebSocket handshake }
wsCloseClientExtensionError= 1010;
{:Server is terminating the connection because it encountered an unexpected condition that prevented it from fulfilling the request }
wsCloseErrorServerRequest = 1011;
{:Connection was closed due to a failure to perform a TLS handshake. This close code MUST NOT be sent by application. }
wsCloseErrorTLS = 1015;
WEBSOCKET_KEY_LEN = 16;
WS_FRAME_MIN_SIZE = 2;
WS_PING_DISABLE = 0;
WS_PING_3MINUTES = 60 * 3;
WS_PING_4MINUTES = 60 * 4;
WS_PING_5MINUTES = 60 * 5;
implementation
end.