instance method
Addrinfo#protocol
() -> ::Integer
addrinfo.protocol => integer
ext/socket/raddrinfo.c
View on GitHub ↗
static VALUE
addrinfo_protocol(VALUE self)
{
rb_addrinfo_t *rai = get_addrinfo(self);
return INT2NUM(rai->protocol);
}
returns the socket type as an integer.
Example
Addrinfo.tcp("localhost", 80).protocol == Socket::IPPROTO_TCP #=> true