<!--
{
  "availability" : [

  ],
  "documentType" : "symbol",
  "framework" : "Event",
  "identifier" : "/documentation/Event/SocketAddress/anyIPv4(port:)",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "Event"
    ],
    "preciseIdentifier" : "s:5Event13SocketAddressV7anyIPv44portACs6UInt16V_tFZ"
  },
  "title" : "anyIPv4(port:)"
}
-->

# anyIPv4(port:)

Creates an IPv4 wildcard address (`0.0.0.0` / `INADDR_ANY`) for the given port.

```
static func anyIPv4(port: UInt16) -> SocketAddress
```

## Parameters

`port`

A port number in host byte order (1-65535). Passing `0` asks
the kernel to assign an ephemeral port, which you can retrieve via `getsockname(2)`
— though swift-event does not currently expose that helper.

## Return Value

A wildcard `SocketAddress` suitable for [`listen(on:backlog:loop:)`](/documentation/Event/Socket/listen(on:backlog:loop:)).

## Discussion

Used when binding a listening server that should accept connections on **any**
local interface. The wildcard semantics are defined by the platform kernel — see
`ip(4)` / RFC 1122 §3.2.1.3 for details.

> SeeAlso: ``doc://Event/documentation/Event/SocketAddress/ipv4(_:port:)``.