An object that represents a message to send or receive, containing protocol metadata and send properties.
- iOS 12.0+
- macOS 10.14+
- Mac Catalyst 13.0+
- tvOS 12.0+
- watchOS 6.0+
- Xcode 10.0+
For sending, you should use
default unless there is a reason to override some values.
You can pass
final to mark the final message in a connection. Once this context is used for sending, and the send is marked as complete, no more data can be sent on the connection.
If you are using a protocol that expects message content, like WebSocket or a custom framer, create a custom context and set metadata using