<!--
{
  "availability" : [

  ],
  "documentType" : "symbol",
  "framework" : "Event",
  "identifier" : "/documentation/Event/SocketError/invalidAddress(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Case",
  "symbol" : {
    "kind" : "Case",
    "modules" : [
      "Event"
    ],
    "preciseIdentifier" : "s:5Event11SocketErrorO14invalidAddressyACSScACmF"
  },
  "title" : "SocketError.invalidAddress(_:)"
}
-->

# SocketError.invalidAddress(_:)

The host string could not be parsed as an IPv4 or IPv6 address.

```
case invalidAddress(String)
```

## Discussion

Thrown by [`ipv4(_:port:)`](/documentation/Event/SocketAddress/ipv4(_:port:)) and [`ipv6(_:port:)`](/documentation/Event/SocketAddress/ipv6(_:port:)) when
the underlying `inet_pton(3)` call returns 0. The payload is the original host
string so callers can log or surface it.