<!--
{
  "availability" : [
    "iOS: 14.0.0 -",
    "iPadOS: 14.0.0 -",
    "macCatalyst: 14.0.0 -",
    "macOS: 11.0.0 -",
    "tvOS: 14.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 7.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Network",
  "identifier" : "/documentation/Network/NWConnectionGroup/Message",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "Network"
    ],
    "preciseIdentifier" : "s:7Network17NWConnectionGroupC7MessageC"
  },
  "title" : "NWConnectionGroup.Message"
}
-->

# NWConnectionGroup.Message

An object that represents a message that you send or receive within a group, and that contains protocol metadata and send properties.

```
class Message
```

## Topics

### Inspecting Received Messages

[`var remoteEndpoint: NWEndpoint?`](/documentation/Network/NWConnectionGroup/Message/remoteEndpoint)

The endpoint that originates the message you receive.

[`var localEndpoint: NWEndpoint?`](/documentation/Network/NWConnectionGroup/Message/localEndpoint)

The local address and port you use to receive the message.

[`var path: NWPath?`](/documentation/Network/NWConnectionGroup/Message/path)

The network path on which you receive the message.

### Replying to Received Messages

[`func reply(content: Data?, message: NWConnectionGroup.Message)`](/documentation/Network/NWConnectionGroup/Message/reply(content:message:))

Sends a reply to the specific endpoint that originates a group message you receive.

[`func extractConnection() -> NWConnection?`](/documentation/Network/NWConnectionGroup/Message/extractConnection())

Converts a message you receive from an endpoint into a connection object that you use for long-term communication with that endpoint.

### Sending Messages

[`static let `default`: NWConnectionGroup.Message`](/documentation/Network/NWConnectionGroup/Message/default)

A static object you use to send a message with default properties.

[`init(identifier: String, expiration: UInt64, priority: Double, isFinal: Bool, antecedent: NWConnection.ContentContext?, metadata: [NWProtocolMetadata]?)`](/documentation/Network/NWConnectionGroup/Message/init(identifier:expiration:priority:isFinal:antecedent:metadata:))

Initializes a custom message context you use to send data.

### Initializers

[`init(nw: nw_content_context_t)`](/documentation/Network/NWConnectionGroup/Message/init(nw:))

### Instance Methods

[`func metadata(definition: NWProtocolDefinition) -> NWProtocolMetadata?`](/documentation/Network/NWConnectionGroup/Message/metadata(definition:))

## Relationships

### Conforms To

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

[`Sendable`](/documentation/Swift/Sendable)

### Inherits From

[`ContentContext`](/documentation/Network/NWConnection/ContentContext)

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)