---
title: "init(rawValue:)"
framework: network
role: symbol
role_heading: Initializer
path: "network/nwprotocolwebsocket/closecode/init(rawvalue:)"
---

# init(rawValue:)

Initializes a close code with a raw value.

## Declaration

```swift
init(rawValue: UInt16) throws
```

## See Also

### Close Code Types

- [NWProtocolWebSocket.CloseCode.protocolCode(_:)](network/nwprotocolwebsocket/closecode/protocolcode(_:).md)
- [NWProtocolWebSocket.CloseCode.Defined](network/nwprotocolwebsocket/closecode/defined.md)
- [NWProtocolWebSocket.CloseCode.applicationCode(_:)](network/nwprotocolwebsocket/closecode/applicationcode(_:).md)
- [NWProtocolWebSocket.CloseCode.privateCode(_:)](network/nwprotocolwebsocket/closecode/privatecode(_:).md)
