End of Life Ruby 3.1 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →
instance method
Addrinfo#socktype
addrinfo.socktype => integer
ext/socket/raddrinfo.c
View on GitHub ↗
static VALUE
addrinfo_socktype(VALUE self)
{
rb_addrinfo_t *rai = get_addrinfo(self);
return INT2NUM(rai->socktype);
}
returns the socket type as an integer.
Example
Addrinfo.tcp("localhost", 80).socktype == Socket::SOCK_STREAM #=> true