constant Socket::Constants::NI_DGRAM

NI_DGRAM -> Integer[permalink][rdoc][edit]

The service specified is a datagram service (looks up UDP ports)。

Socket.getnameinfo, Addrinfo#getnameinfo の引数 flags に渡す定数です。

require 'socket'

Socket.getnameinfo([ Socket::AF_INET, 514, "127.0.0.1"], Socket::NI_DGRAM)
# => ["localhost", "syslog"]
Socket.getnameinfo([ Socket::AF_INET, 514, "127.0.0.1"])
# => ["localhost", "shell"]

[SEE_ALSO] getnameinfo(3)