static VALUE socks_s_close(sock) VALUE sock; { OpenFile *fptr; if (rb_safe_level() >= 4 && !OBJ_TAINTED(sock)) { rb_raise(rb_eSecurityError, "Insecure: can't close socket"); } GetOpenFile(sock, fptr); shutdown(fileno(fptr->f), 2); shutdown(fileno(fptr->f2), 2); return rb_io_close(sock); }