Skip to content

Commit a0cab38

Browse files
Add close code 3008 (timeout)
1 parent 9598d78 commit a0cab38

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

src/closecode.ts

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,17 @@
77

88
export const enum CloseCode {
99
ClosingNormal = 1000,
10-
GoingAway,
11-
NoSharedSubprotocol,
10+
GoingAway = 1001,
11+
NoSharedSubprotocol = 1002,
1212
PathFull = 3000,
13-
ProtocolError,
14-
InternalError,
15-
Handover,
16-
DroppedByInitiator,
17-
InitiatorCouldNotDecrypt,
18-
NoSharedTask,
19-
InvalidKey,
13+
ProtocolError = 3001,
14+
InternalError = 3002,
15+
Handover = 3003,
16+
DroppedByInitiator = 3004,
17+
InitiatorCouldNotDecrypt = 3005,
18+
NoSharedTask = 3006,
19+
InvalidKey = 3007,
20+
Timeout = 3008,
2021
}
2122

2223
export function explainCloseCode(code: CloseCode): string {
@@ -43,6 +44,8 @@ export function explainCloseCode(code: CloseCode): string {
4344
return 'No shared task was found';
4445
case CloseCode.InvalidKey:
4546
return 'Invalid key';
47+
case CloseCode.Timeout:
48+
return 'Timeout';
4649
default:
4750
return 'Unknown';
4851
}

0 commit comments

Comments
 (0)