A code that indicates why a WebSocket connection closed.
SDKs
- iOS 13.0+
- macOS 10.15+
- Mac Catalyst 13.0+
- tvOS 13.0+
- watchOS 6.0+
Framework
- Foundation
A code that indicates why a WebSocket connection closed.
SDKs
Framework
NSURLSession Web Socket Close Code Abnormal Closure
A reserved code that indicates the connection closed without a close control frame.
NSURLSession Web Socket Close Code Going Away
A code that indicates an endpoint is going away.
NSURLSession Web Socket Close Code Internal Server Error
A code that indicates the server terminated the connection because it encountered an unexpected condition.
NSURLSession Web Socket Close Code Invalid
A code that indicates the connection is still open.
NSURLSession Web Socket Close Code Invalid Frame Payload Data
A code that indicates the server terminated the connection because it received data inconsistent with the message’s type.
NSURLSession Web Socket Close Code Mandatory Extension Missing
A code that indicates the client terminated the connection because the server didn’t negotiate a required extension.
NSURLSession Web Socket Close Code Message Too Big
A code that indicates an endpoint is terminating the connection because it received a message too big for it to process.
NSURLSession Web Socket Close Code No Status Received
A reserved code that indicates an endpoint expected a status code and didn’t receive one.
NSURLSession Web Socket Close Code Normal Closure
A code that indicates normal connection closure.
NSURLSession Web Socket Close Code Policy Violation
A code that indicates an endpoint terminated the connection because it received a message that violates its policy.
NSURLSession Web Socket Close Code Protocol Error
A code that indicates an endpoint terminated the connection due to a protocol error.
NSURLSession Web Socket Close Code TLSHandshake Failure
A reserved code that indicates the connection closed due to the failure to perform a TLS handshake.
NSURLSession Web Socket Close Code Unsupported Data
A code that indicates an endpoint terminated the connection after receiving a type of data it can’t accept.
- cancel With Close Code: reason:
Sends a close frame with the given close code and optional close reason.
close Code
A code that indicates the reason a connection closed.
close Reason
A block of data that provides further information about why a connection closed.