<!--
{
  "availability" : [

  ],
  "documentType" : "symbol",
  "framework" : "Event",
  "identifier" : "/documentation/Event/ServerSocket/localAddress",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "Event"
    ],
    "preciseIdentifier" : "s:5Event12ServerSocketC12localAddressAA0cE0VSgvp"
  },
  "title" : "localAddress"
}
-->

# localAddress

The local endpoint this listener is bound to, as reported by `getsockname(2)`.

```
var localAddress: SocketAddress? { get }
```

## Discussion

Useful for `port: 0` binds where the kernel assigns an ephemeral port —
read this back to learn which port clients should connect to. Returns
`nil` if the descriptor is closed or the syscall fails for any reason.