One Logo Pool Ball
Network · IOS API REFERENCE

NWProtocolWebSocket.CloseCode

enum · iOS 13.0+ · SDK 27.1

enum CloseCode

A WebSocket close code describes the reason for closing a WebSocket connection. Endpoints may use the following pre-defined close codes when sending a Close frame.

Members (1)

init · iOS 13.0+

init

TypeScript
static init(rawValue: number): NWProtocolWebSocket_CloseCode
Swift declaration
init(rawValue: UInt16) throws

Create a WebSocket close code from a UInt16 value. - Parameter rawValue: The raw value of the close code. The close code ranges are: 0-999 Status codes in the range 0-999 are not used. 1000-2999 Status codes in the range 1000-2999 are reserved for definition by WebSocket, its future revisions, and extensions specified in a permanent and readily available public specification. 3000-3999 Status codes in the range 3000-3999 are reserved for use by libraries, frameworks, and applications. These close codes are registered directly with IANA. The interpretation of these codes is undefined by WebSocket. 4000-4999 Status codes in the range 4000-4999 are reserved for private use and thus can't be registered. Such codes can be used by prior agreements between WebSocket applications. The interpretation of these codes is undefined by WebSocket.

Skipped declarations

No declarations were skipped in this snapshot.

All Network types →