Skip to content
instance method

Addrinfo#ip_port

() -> ::Integer
addrinfo.ip_port => port

Returns the port number as an integer.

Example
Addrinfo.tcp("127.0.0.1", 80).ip_port    #=> 80
Addrinfo.tcp("::1", 80).ip_port          #=> 80
See also #ip_address #ip_unpack #ip? #ipv4? also in 4.1 · 3.4 · 3.3 · 3.2 · 3.1 · 3.0