---
title: addresses
framework: foundation
role: symbol
role_heading: Instance Property
path: foundation/netservice/addresses
---

# addresses

A read-only array containing NSData objects, each of which contains a socket address for the service.

## Declaration

```swift
var addresses: [Data]? { get }
```

## Discussion

Discussion An array containing NSData objects, each of which contains a socket address for the service. Each NSData object in the returned array contains an appropriate sockaddr structure that you can use to connect to the socket. The exact type of this structure depends on the service to which you are connecting. If no addresses were resolved for the service, the returned array contains zero elements. It is possible for a single service to resolve to more than one address or not resolve to any addresses. A service might resolve to multiple addresses if the computer publishing the service is currently multihoming. note: This became a property in OS X v10.9 and iOS 7, but the underlying getter method (addresses) has been available since this class was first introduced.

## See Also

### Related Documentation

- [resolve()](foundation/netservice/resolve().md)

### Configuring Network Services

- [data(fromTXTRecord:)](foundation/netservice/data(fromtxtrecord:).md)
- [dictionary(fromTXTRecord:)](foundation/netservice/dictionary(fromtxtrecord:).md)
- [domain](foundation/netservice/domain.md)
- [includesPeerToPeer](foundation/netservice/includespeertopeer.md)
- [getInputStream(_:outputStream:)](foundation/netservice/getinputstream(_:outputstream:).md)
- [name](foundation/netservice/name.md)
- [type](foundation/netservice/type.md)
- [txtRecordData()](foundation/netservice/txtrecorddata().md)
- [setTXTRecord(_:)](foundation/netservice/settxtrecord(_:).md)
- [delegate](foundation/netservice/delegate.md)
