Method: Addrinfo#socktype

Defined in:
raddrinfo.c

#socktypeInteger

returns the socket type as an integer.

Addrinfo.tcp("localhost", 80).socktype == Socket::SOCK_STREAM #=> true

Returns:

  • (Integer)


2219
2220
2221
2222
2223
2224
# File 'raddrinfo.c', line 2219

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