Initializer
init(ipAddress:port:)
Creates an address from an IP literal, returning
nil if ipAddress is not one.init?(ipAddress: String, port: Int)
Parameters
ipAddressA dotted-quad IPv4 literal, or an IPv6 literal without a zone index.
portThe port, stored as given and not range-checked.
Discussion
Only literals are accepted — a hostname is never resolved, so this never performs I/O and is safe to call on any thread. Which of SocketAddress.Kind.ipv4 or SocketAddress.Kind.ipv6 results is decided by the literal itself.
Parsing is deliberately stricter than the platform’s inet_pton: octets with leading zeros and IPv6 zone indices are both refused, so the same string is accepted or rejected identically on every platform Vapor runs on.