---
title: "CFSocketCopyAddress(_:)"
framework: corefoundation
role: symbol
role_heading: Function
path: "corefoundation/cfsocketcopyaddress(_:)"
---

# CFSocketCopyAddress(_:)

Returns the local address of a CFSocket object.

## Declaration

```swift
func CFSocketCopyAddress(_ s: CFSocket!) -> CFData!
```

## Parameters

- `s`: The CFSocket object to examine.

## Return Value

Return Value The local address, stored as a struct sockaddr appropriate for the protocol family (struct sockaddr_in or struct sockaddr_in6, for example) in a CFData object, of s. Ownership follows the The Create Rule.

## See Also

### Configuring Sockets

- [CFSocketCopyPeerAddress(_:)](corefoundation/cfsocketcopypeeraddress(_:).md)
- [CFSocketDisableCallBacks(_:_:)](corefoundation/cfsocketdisablecallbacks(_:_:).md)
- [CFSocketEnableCallBacks(_:_:)](corefoundation/cfsocketenablecallbacks(_:_:).md)
- [CFSocketGetContext(_:_:)](corefoundation/cfsocketgetcontext(_:_:).md)
- [CFSocketGetNative(_:)](corefoundation/cfsocketgetnative(_:).md)
- [CFSocketGetSocketFlags(_:)](corefoundation/cfsocketgetsocketflags(_:).md)
- [CFSocketSetAddress(_:_:)](corefoundation/cfsocketsetaddress(_:_:).md)
- [CFSocketSetSocketFlags(_:_:)](corefoundation/cfsocketsetsocketflags(_:_:).md)
