---
title: extractConnection()
framework: network
role: symbol
role_heading: Instance Method
path: network/nwconnectiongroup/message/extractconnection()
---

# extractConnection()

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

## Declaration

```swift
func extractConnection() -> NWConnection?
```

## See Also

### Replying to Received Messages

- [reply(content:message:)](network/nwconnectiongroup/message/reply(content:message:).md)
