Method: Addrinfo#protocol

Defined in:
raddrinfo.c

#protocolInteger

returns the socket type as an integer.

Addrinfo.tcp("localhost", 80).protocol == Socket::IPPROTO_TCP #=> true

Returns:

  • (Integer)


2235
2236
2237
2238
2239
2240
# File 'raddrinfo.c', line 2235

static VALUE
addrinfo_protocol(VALUE self)
{
    rb_addrinfo_t *rai = get_addrinfo(self);
    return INT2NUM(rai->protocol);
}