1 //------------------------------------------------------------------------------
2 // <copyright file="WebSocketCloseStatus.cs" company="Microsoft">
3 // Copyright (c) Microsoft Corporation. All rights reserved.
5 //------------------------------------------------------------------------------
6 namespace System.Net.WebSockets
8 using System.Diagnostics.CodeAnalysis;
10 [SuppressMessage("Microsoft.Design",
11 "CA1008:EnumsShouldHaveZeroValue",
12 Justification = "This enum is reflecting the IETF's WebSocket specification. " +
13 "'0' is a disallowed value for the close status code")]
14 public enum WebSocketCloseStatus
17 EndpointUnavailable = 1001,
19 InvalidMessageType = 1003,
21 // AbnormalClosure = 1006, // 1006 is reserved and should never be used by user
22 InvalidPayloadData = 1007,
23 PolicyViolation = 1008,
25 MandatoryExtension = 1010,
26 InternalServerError = 1011
27 // TLSHandshakeFailed = 1015, // 1015 is reserved and should never be used by user
29 // 0 - 999 Status codes in the range 0-999 are not used.
30 // 1000 - 1999 Status codes in the range 1000-1999 are reserved for definition by this protocol.
31 // 2000 - 2999 Status codes in the range 2000-2999 are reserved for use by extensions.
32 // 3000 - 3999 Status codes in the range 3000-3999 MAY be used by libraries and frameworks. The
33 // interpretation of these codes is undefined by this protocol. End applications MUST
34 // NOT use status codes in this range.
35 // 4000 - 4999 Status codes in the range 4000-4999 MAY be used by application code. The interpretaion
36 // of these codes is undefined by this protocol.