Enumeration

NSURLSessionWebSocketCloseCode

A code that indicates why a WebSocket connection closed.

Declaration

typedef enum NSURLSessionWebSocketCloseCode : NSInteger {
    ...
} NSURLSessionWebSocketCloseCode;

Overview

The WebSocket close codes follow the close codes defined in RFC 6455.

Topics

Close Codes

NSURLSessionWebSocketCloseCodeAbnormalClosure

A reserved code that indicates the connection closed without a close control frame.

NSURLSessionWebSocketCloseCodeGoingAway

A code that indicates an endpoint is going away.

NSURLSessionWebSocketCloseCodeInternalServerError

A code that indicates the server terminated the connection because it encountered an unexpected condition.

NSURLSessionWebSocketCloseCodeInvalid

A code that indicates the connection is still open.

NSURLSessionWebSocketCloseCodeInvalidFramePayloadData

A code that indicates the server terminated the connection because it received data inconsistent with the message’s type.

NSURLSessionWebSocketCloseCodeMandatoryExtensionMissing

A code that indicates the client terminated the connection because the server didn’t negotiate a required extension.

NSURLSessionWebSocketCloseCodeMessageTooBig

A code that indicates an endpoint is terminating the connection because it received a message too big for it to process.

NSURLSessionWebSocketCloseCodeNoStatusReceived

A reserved code that indicates an endpoint expected a status code and didn’t receive one.

NSURLSessionWebSocketCloseCodeNormalClosure

A code that indicates normal connection closure.

NSURLSessionWebSocketCloseCodePolicyViolation

A code that indicates an endpoint terminated the connection because it received a message that violates its policy.

NSURLSessionWebSocketCloseCodeProtocolError

A code that indicates an endpoint terminated the connection due to a protocol error.

NSURLSessionWebSocketCloseCodeTLSHandshakeFailure

A reserved code that indicates the connection closed due to the failure to perform a TLS handshake.

NSURLSessionWebSocketCloseCodeUnsupportedData

A code that indicates an endpoint terminated the connection after receiving a type of data it can’t accept.

See Also

Closing the Connection

- cancelWithCloseCode:reason:

Sends a close frame with the given close code and optional close reason.

closeCode

A code that indicates the reason a connection closed.

closeReason

A block of data that provides further information about why a connection closed.