Flowdock
shutdown(p1 = v1) public

No documentation

This method has no description. You can help the Ruby community by adding new notes.

Hide source
static VALUE
bsock_shutdown(int argc, VALUE *argv, VALUE sock)
{
    VALUE howto;
    int how;
    rb_io_t *fptr;

    if (rb_safe_level() >= 4 && !OBJ_TAINTED(sock)) {
        rb_raise(rb_eSecurityError, "Insecure: can't shutdown socket");
    }
    rb_scan_args(argc, argv, "01", &howto);
    if (howto == Qnil)
        how = 2;
    else {
        how = NUM2INT(howto);
        if (how < 0 || 2 < how) {
            rb_raise(rb_eArgError, "`how' should be either 0, 1, 2");
        }
    }
    GetOpenFile(sock, fptr);
    if (shutdown(fptr->fd, how) == -1)
        rb_sys_fail(0);

    return INT2FIX(0);
}
Register or log in to add new notes.