One Logo Pool Ball
Network · IOS API REFERENCE

NWConnectionGroup.Message

class · iOS 14.0+ · SDK 27.1

class Message

A connection group message allows a caller to set or retrieve metadata about data being sent between endpoints. All properties of an `NWConnection.ContentContext` are inherited, such as priority, protocol metadata, and expiration. Beyond this, group messages carry data about the local and remote endpoints and the network path.

Members (8)

get · iOS 14.0+

localEndpoint

TypeScript
get localEndpoint(): (NWEndpoint) | null
Swift declaration
var localEndpoint: NWEndpoint? { get }

Access the local endpoint to which this message was sent. `localEndpoint` will be `nil` for messages that you send.

get · iOS 14.0+

remoteEndpoint

TypeScript
get remoteEndpoint(): (NWEndpoint) | null
Swift declaration
var remoteEndpoint: NWEndpoint? { get }

Access the remote endpoint that sent this message. `remoteEndpoint` will be `nil` for messages that you send.

method · iOS 14.0+

extractConnection

TypeScript
extractConnection(): (NWConnection) | null
Swift declaration
func extractConnection() -> NWConnection?

Extract an `NWConnection` corresponding to this received message that can be used to read the remainder of a partial message or to send a large response, with support for partial messages and backpressure, to the endpoint that sent this message. Once extracted, subsequent messages from this remote endpoint on this connection will no longer be handled by the connection group.

init · iOS 17.0+

init

TypeScript
static init(nw: Implements<OS_nw_content_context> | SDKHandle): NWConnectionGroup_Message
Swift declaration
init(nw: nw_content_context_t)
get · iOS 14.0+

path

TypeScript
get path(): (NWPath) | null
Swift declaration
var path: NWPath? { get }

Access the path over which this message was received. `path` will be `nil` for messages that you send.

method · iOS 14.0+

reply

TypeScript
reply(content?: (ArrayBuffer) | null, message?: NWConnectionGroup_Message): void
Swift declaration
func reply(content: Data?, message: NWConnectionGroup.Message = .default)

Send a reply to this message with an outgoing message object.

get · iOS 14.0+

default

TypeScript
static get default(): NWConnectionGroup_Message
Swift declaration
static let `default`: NWConnectionGroup.Message

Use the default message to send content with all default properties: default priority and no expiration. This message does not have any associated local endpoint, remote endpoint, or path.

method · iOS 15.0+

metadata

TypeScript
metadata(definition: NWProtocolDefinition): (NWProtocolMetadata) | null
Swift declaration
func metadata(definition: NWProtocolDefinition) -> NWProtocolMetadata?

Skipped declarations

1 declarations were excluded from these bindings. Each reason comes from the generator or the iOS SDK compiler.

NWConnectionGroup.Message.init(identifier:expiration:priority:isFinal:antecedent:metadata:)

The iOS SDK compiler rejected this binding: 'super' cannot be used in non-class type 'OneSDK_Network'

All Network types →