Skip to content

End of Life Ruby 3.1 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →

class method

Socket::AncillaryData.new

Socket::AncillaryData.new(family, cmsg_level, cmsg_type, cmsg_data) → ancillarydata

family should be an integer, a string or a symbol.

cmsg_level should be an integer, a string or a symbol.

cmsg_type should be an integer, a string or a symbol. If a string/symbol is specified, it is interpreted depend on cmsg_level.

cmsg_data should be a string.

Example
p Socket::AncillaryData.new(:INET, :TCP, :NODELAY, "")
#=> #<Socket::AncillaryData: INET TCP NODELAY "">

p Socket::AncillaryData.new(:INET6, :IPV6, :PKTINFO, "")
#=> #<Socket::AncillaryData: INET6 IPV6 PKTINFO "">
See also .ipv6_pktinfo .unix_rights .ip_pktinfo #cmsg_is? also in 4.1 · 4.0 · 3.4 · 3.3 · 3.2 · 3.0