---
title: connection
framework: foundation
role: symbol
role_heading: Instance Method
path: foundation/nsportcoder/connection
---

# connection

Returns the NSConnection object that uses the receiver.

## Declaration

```occ
- (NSConnection *) connection;
```

## Return Value

Return Value The NSConnection object that uses the receiver. In an object’s encode(with:) method, this is the sending (server) connection. In init(coder:) this is the receiving (client) connection.
