Skip to content

Preview Ruby 4.1 is a preview. It can change before the final release. Switch to Ruby 4.0 →

class method

Socket::Option.ipv4_multicast_loop

Socket::Option.ipv4_multicast_loop(integer) => sockopt

Creates a new Socket::Option object for IP_MULTICAST_LOOP.

The size is dependent on the platform.

Example
sockopt = Socket::Option.int(:INET, :IPPROTO_IP, :IP_MULTICAST_LOOP, 1)
p sockopt.int => 1

p Socket::Option.ipv4_multicast_loop(10)
#=> #<Socket::Option: INET IP MULTICAST_LOOP 10>