Preview Ruby 4.1 is a preview. It can change before the final release. Switch to Ruby 4.0 →
instance method
Socket::Option#ipv4_multicast_loop
sockopt.ipv4_multicast_loop => integer
ext/socket/option.c
View on GitHub ↗
static VALUE
sockopt_ipv4_multicast_loop(VALUE self)
{
int family = NUM2INT(sockopt_family_m(self));
int level = sockopt_level(self);
int optname = sockopt_optname(self);
#if defined(IPPROTO_IP) && defined(IP_MULTICAST_LOOP)
if (family == AF_INET && level == IPPROTO_IP && optname == IP_MULTICAST_LOOP) {
return XCAT(sockopt_,TYPE_IP_MULTICAST_LOOP)(self);
}
#endif
rb_raise(rb_eTypeError, "ipv4_multicast_loop socket option expected");
UNREACHABLE_RETURN(Qnil);
}
Returns the ipv4_multicast_loop data in sockopt as an integer.
Example
sockopt = Socket::Option.ipv4_multicast_loop(10) p sockopt.ipv4_multicast_loop => 10
See also
.ipv4_multicast_loop
#int
#ipv4_multicast_ttl
#inspect
also in
4.0 · 3.4 · 3.3 · 3.2 · 3.1 · 3.0