|
|
|
|
@ -31,20 +31,18 @@ using System;
|
|
|
|
|
namespace WebSocketSharp
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Contains the values of the status codes for the WebSocket connection
|
|
|
|
|
/// closure.
|
|
|
|
|
/// Contains the values of the status codes for the WebSocket connection closure.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <remarks>
|
|
|
|
|
/// <para>
|
|
|
|
|
/// The CloseStatusCode enumeration contains the values of the status codes
|
|
|
|
|
/// for the WebSocket connection closure defined in
|
|
|
|
|
/// The status codes for the WebSocket connection closure are defined in
|
|
|
|
|
/// <a href="http://tools.ietf.org/html/rfc6455#section-7.4.1">RFC 6455</a>
|
|
|
|
|
/// for the WebSocket protocol.
|
|
|
|
|
/// </para>
|
|
|
|
|
/// <para>
|
|
|
|
|
/// "Reserved value" must not be set as a status code in a close control frame
|
|
|
|
|
/// by an endpoint. It's designated for use in applications expecting a status
|
|
|
|
|
/// code to indicate that the connection was closed due to a system grounds.
|
|
|
|
|
/// "Reserved value" must not be set as a status code in a close control frame by
|
|
|
|
|
/// an endpoint. It's designated for use in applications expecting a status code
|
|
|
|
|
/// to indicate that the connection was closed due to a system grounds.
|
|
|
|
|
/// </para>
|
|
|
|
|
/// </remarks>
|
|
|
|
|
public enum CloseStatusCode : ushort
|
|
|
|
|
@ -53,78 +51,74 @@ namespace WebSocketSharp
|
|
|
|
|
/// Equivalent to close status 1000.
|
|
|
|
|
/// Indicates a normal closure.
|
|
|
|
|
/// </summary>
|
|
|
|
|
NORMAL = 1000,
|
|
|
|
|
Normal = 1000,
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Equivalent to close status 1001.
|
|
|
|
|
/// Indicates that an endpoint is "going away".
|
|
|
|
|
/// Indicates that an endpoint is going away.
|
|
|
|
|
/// </summary>
|
|
|
|
|
AWAY = 1001,
|
|
|
|
|
Away = 1001,
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Equivalent to close status 1002.
|
|
|
|
|
/// Indicates that an endpoint is terminating the connection due to a protocol
|
|
|
|
|
/// error.
|
|
|
|
|
/// Indicates that an endpoint is terminating the connection due to a protocol error.
|
|
|
|
|
/// </summary>
|
|
|
|
|
PROTOCOL_ERROR = 1002,
|
|
|
|
|
ProtocolError = 1002,
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Equivalent to close status 1003.
|
|
|
|
|
/// Indicates that an endpoint is terminating the connection because it has
|
|
|
|
|
/// received a type of data it cannot accept.
|
|
|
|
|
/// Indicates that an endpoint is terminating the connection because it has received an
|
|
|
|
|
/// unacceptable type message.
|
|
|
|
|
/// </summary>
|
|
|
|
|
INCORRECT_DATA = 1003,
|
|
|
|
|
IncorrectData = 1003,
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Equivalent to close status 1004.
|
|
|
|
|
/// Still undefined. Reserved value.
|
|
|
|
|
/// </summary>
|
|
|
|
|
UNDEFINED = 1004,
|
|
|
|
|
Undefined = 1004,
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Equivalent to close status 1005.
|
|
|
|
|
/// Indicates that no status code was actually present. Reserved value.
|
|
|
|
|
/// </summary>
|
|
|
|
|
NO_STATUS_CODE = 1005,
|
|
|
|
|
NoStatusCode = 1005,
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Equivalent to close status 1006.
|
|
|
|
|
/// Indicates that the connection was closed abnormally. Reserved value.
|
|
|
|
|
/// </summary>
|
|
|
|
|
ABNORMAL = 1006,
|
|
|
|
|
Abnormal = 1006,
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Equivalent to close status 1007.
|
|
|
|
|
/// Indicates that an endpoint is terminating the connection because it has
|
|
|
|
|
/// received the data within a message that wasn't consistent with the type of
|
|
|
|
|
/// the message.
|
|
|
|
|
/// Indicates that an endpoint is terminating the connection because it has received a message
|
|
|
|
|
/// that contains a data that isn't consistent with the type of the message.
|
|
|
|
|
/// </summary>
|
|
|
|
|
INCONSISTENT_DATA = 1007,
|
|
|
|
|
InconsistentData = 1007,
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Equivalent to close status 1008.
|
|
|
|
|
/// Indicates that an endpoint is terminating the connection because it has
|
|
|
|
|
/// received a message that violates its policy.
|
|
|
|
|
/// Indicates that an endpoint is terminating the connection because it has received a message
|
|
|
|
|
/// that violates its policy.
|
|
|
|
|
/// </summary>
|
|
|
|
|
POLICY_VIOLATION = 1008,
|
|
|
|
|
PolicyViolation = 1008,
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Equivalent to close status 1009.
|
|
|
|
|
/// Indicates that an endpoint is terminating the connection because it has
|
|
|
|
|
/// received a message that is too big to process.
|
|
|
|
|
/// Indicates that an endpoint is terminating the connection because it has received a message
|
|
|
|
|
/// that is too big to process.
|
|
|
|
|
/// </summary>
|
|
|
|
|
TOO_BIG = 1009,
|
|
|
|
|
TooBig = 1009,
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Equivalent to close status 1010.
|
|
|
|
|
/// Indicates that an endpoint (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.
|
|
|
|
|
/// Indicates that the 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 handshake
|
|
|
|
|
/// response.
|
|
|
|
|
/// </summary>
|
|
|
|
|
IGNORE_EXTENSION = 1010,
|
|
|
|
|
IgnoreExtension = 1010,
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Equivalent to close status 1011.
|
|
|
|
|
/// Indicates that the server is terminating the connection because it has
|
|
|
|
|
/// encountered an unexpected condition that prevented it from fulfilling the
|
|
|
|
|
/// request.
|
|
|
|
|
/// Indicates that the server is terminating the connection because it has encountered an
|
|
|
|
|
/// unexpected condition that prevented it from fulfilling the request.
|
|
|
|
|
/// </summary>
|
|
|
|
|
SERVER_ERROR = 1011,
|
|
|
|
|
ServerError = 1011,
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Equivalent to close status 1015.
|
|
|
|
|
/// Indicates that the connection was closed due to a failure to perform a TLS
|
|
|
|
|
/// handshake. Reserved value.
|
|
|
|
|
/// Indicates that the connection was closed due to a failure to perform a TLS handshake.
|
|
|
|
|
/// Reserved value.
|
|
|
|
|
/// </summary>
|
|
|
|
|
TLS_HANDSHAKE_FAILURE = 1015
|
|
|
|
|
TlsHandshakeFailure = 1015
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|