Type Method
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:).
Mentioned In
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.
See Also
ipv4(_:port:).