6.90. kink/socket/IP_PORT¶
6.90.1. type ip_port¶
`ip_port` is a pair of an IP address and a port number. `ip_port` is a subtype of type `socket_address`.
Port number of 0 indicates that an ephemeral port should be assigned in `bind` operations, like Udp_socket.bind, Tcp.bind, and Tcp_server.bind_listen.
6.90.1.1. Ipp.ip¶
`ip` method returns the IP address, in type `ip`.
6.90.1.2. Ipp.port¶
`port` returns the port number as an integer `num`.
6.90.1.3. Ipp.protocol_family¶
`protocol_family` returns either PROTOCOL_FAMILY.ipv4 or PROTOCOL_FAMILY.ipv6.
6.90.1.4. X == Y¶
`==` operator, or `op_eq` method, returns whether `Y` is an `ip_port`, and `X` and `Y` have the same IP address and the same port number.
Precondition
`Y` must be a `socket_address`.
6.90.2. IP_PORT.new(Ip Port)¶
`new` makes a new `ip_port` value.
Preconditions
`Ip` must be an `ip`.
`Port` must be an integer `num` in the range [0, 65535].
6.90.3. IP_PORT.is?(Val)¶
`is?` returns whether `Val` is an `ip_port`.