End of Life Ruby 3.2 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →
instance method
Socket::Option#ipv4_multicast_ttl
sockopt.ipv4_multicast_ttl => integer
ext/socket/option.c
View on GitHub ↗
static VALUE
sockopt_ipv4_multicast_ttl(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_TTL)
if (family == AF_INET && level == IPPROTO_IP && optname == IP_MULTICAST_TTL) {
return XCAT(sockopt_,TYPE_IP_MULTICAST_TTL)(self);
}
#endif
rb_raise(rb_eTypeError, "ipv4_multicast_ttl socket option expected");
UNREACHABLE_RETURN(Qnil);
}
Returns the ipv4_multicast_ttl data in sockopt as an integer.
Example
sockopt = Socket::Option.ipv4_multicast_ttl(10) p sockopt.ipv4_multicast_ttl => 10
See also
.ipv4_multicast_ttl
#ipv4_multicast_loop
#level
#int
also in
4.1 · 4.0 · 3.4 · 3.3 · 3.1 · 3.0