A representation of 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+
For sending, you should use NW_CONNECTION_DEFAULT_MESSAGE_CONTEXT unless there is a reason to override some values.
You can pass NW_CONNECTION_FINAL_MESSAGE_CONTEXT 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