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.int

Socket::AncillaryData.int(family, cmsg_level, cmsg_type, integer) => ancillarydata

Creates a new Socket::AncillaryData object which contains a int as data.

The size and endian is dependent on the host.

Example
require 'socket'

p Socket::AncillaryData.int(:UNIX, :SOCKET, :RIGHTS, STDERR.fileno)
#=> #<Socket::AncillaryData: UNIX SOCKET RIGHTS 2>
See also #int .ip_pktinfo .ipv6_pktinfo also in 4.1 · 4.0 · 3.4 · 3.3 · 3.2 · 3.0