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
case abnormal Closure
A reserved code that indicates the connection closed without a close control frame.
case going Away
A code that indicates an endpoint is going away.
case internal Server Error
A code that indicates the server terminated the connection because it encountered an unexpected condition.
case invalid
A code that indicates the connection is still open.
case invalid Frame Payload Data
A code that indicates the server terminated the connection because it received data inconsistent with the message’s type.
case mandatory Extension Missing
A code that indicates the client terminated the connection because the server didn’t negotiate a required extension.
case message Too Big
A code that indicates an endpoint is terminating the connection because it received a message too big for it to process.
case no Status Received
A reserved code that indicates an endpoint expected a status code and didn’t receive one.
case normal Closure
A code that indicates normal connection closure.
case policy Violation
A code that indicates an endpoint terminated the connection because it received a message that violates its policy.
case protocol Error
A code that indicates an endpoint terminated the connection due to a protocol error.
case tls Handshake Failure
A reserved code that indicates the connection closed due to the failure to perform a TLS handshake.
case unsupported Data
A code that indicates an endpoint terminated the connection after receiving a type of data it can’t accept.
func cancel(with: URLSession Web Socket Task .Close Code, reason: Data?)
Sends a close frame with the given close code and optional close reason.
var close Code: URLSession Web Socket Task .Close Code
A code that indicates the reason a connection closed.
var close Reason: Data?
A block of data that provides further information about why a connection closed.