@Nullable
    private static InetSocketAddress createSocketAddress(Port p) {
        final InetAddress address = p.getAddress();
        final String ip = p.getIp();
        final int port = p.getPort();
        if (ip != null && address != null) {
            throw new IllegalStateException("A port cannot have both IP and address: " + p);
        }
        final InetSocketAddress targetAddress;
        if (ip != null) {
            if (NetUtil.isValidIpV4Address(ip) || NetUtil.isValidIpV6Address(ip)) {
                final byte[] bytes = NetUtil.createByteArrayFromIpAddressString(ip);
                try {
                    targetAddress = new InetSocketAddress(InetAddress.getByAddress(bytes), port);
                } catch (UnknownHostException e) {
                    // Should never happen.
                    throw new Error(e);
                }
            } else {
                throw new IllegalStateException("invalid IP address: " + ip);
            }
        } else if (address != null) {
            targetAddress = new InetSocketAddress(address, port);
        } else {
            targetAddress = null;
        }
        return targetAddress;
    }
Adds {@link Port}s to the specified {@link ServerBuilder}.
spring/boot3-autoconfigure/src/main/java/com/linecorp/armeria/internal/spring/ArmeriaConfigurationNetUtil.java