---
title: "send(content:to:message:completion:)"
framework: network
role: symbol
role_heading: Instance Method
path: "network/nwconnectiongroup/send(content:to:message:completion:)"
---

# send(content:to:message:completion:)

Sends data to the entire group, or to a specific member of the group.

## Declaration

```swift
@preconcurrency final func send(content: Data?, to: NWEndpoint? = nil, message: NWConnectionGroup.Message = .default, completion: @escaping (NWError?) -> Void)
```

## Parameters

- `content`: The data to send.
- `to`: An optional endpoint that specifies a member of the group that receives the data. If the endpoint is nil, the data will be sent to the entire group.
- `message`: The metadata that defines how the message is sent.
- `completion`: A completion that notifies you when the connection group has processed and sent the data.

## See Also

### Sending and Receiving Group Messages

- [setReceiveHandler(maximumMessageSize:rejectOversizedMessages:handler:)](network/nwconnectiongroup/setreceivehandler(maximummessagesize:rejectoversizedmessages:handler:).md)
- [NWConnectionGroup.Message](network/nwconnectiongroup/message.md)
