ext/socket/basicsocket.c File Reference

#include "rubysocket.h"

Go to the source code of this file.

Defines

#define bsock_getpeereid   rb_f_notimplement

Functions

static VALUE bsock_s_for_fd (VALUE klass, VALUE fd)
static VALUE bsock_shutdown (int argc, VALUE *argv, VALUE sock)
static VALUE bsock_close_read (VALUE sock)
static VALUE bsock_close_write (VALUE sock)
static VALUE bsock_setsockopt (int argc, VALUE *argv, VALUE sock)
static VALUE bsock_getsockopt (VALUE sock, VALUE lev, VALUE optname)
static VALUE bsock_getsockname (VALUE sock)
static VALUE bsock_getpeername (VALUE sock)
static VALUE bsock_local_address (VALUE sock)
static VALUE bsock_remote_address (VALUE sock)
VALUE rsock_bsock_send (int argc, VALUE *argv, VALUE sock)
static VALUE bsock_do_not_reverse_lookup (VALUE sock)
static VALUE bsock_do_not_reverse_lookup_set (VALUE sock, VALUE state)
static VALUE bsock_recv (int argc, VALUE *argv, VALUE sock)
static VALUE bsock_recv_nonblock (int argc, VALUE *argv, VALUE sock)
static VALUE bsock_do_not_rev_lookup (void)
static VALUE bsock_do_not_rev_lookup_set (VALUE self, VALUE val)
void rsock_init_basicsocket (void)


Define Documentation

#define bsock_getpeereid   rb_f_notimplement

Definition at line 455 of file basicsocket.c.

Referenced by rsock_init_basicsocket().


Function Documentation

static VALUE bsock_close_read ( VALUE  sock  )  [static]

Definition at line 99 of file basicsocket.c.

References rb_io_t::fd, FMODE_READABLE, FMODE_WRITABLE, GetOpenFile, rb_io_t::mode, OBJ_TAINTED, Qnil, rb_eSecurityError, rb_io_close(), rb_raise(), rb_safe_level, and shutdown.

Referenced by rsock_init_basicsocket().

static VALUE bsock_close_write ( VALUE  sock  )  [static]

Definition at line 132 of file basicsocket.c.

References rb_io_t::fd, FMODE_READABLE, FMODE_WRITABLE, GetOpenFile, rb_io_t::mode, OBJ_TAINTED, Qnil, rb_eSecurityError, rb_io_close(), rb_raise(), rb_safe_level, and shutdown.

Referenced by rsock_init_basicsocket().

static VALUE bsock_do_not_rev_lookup ( void   )  [static]

Definition at line 710 of file basicsocket.c.

References Qfalse, Qtrue, and rsock_do_not_reverse_lookup.

Referenced by rsock_init_basicsocket().

static VALUE bsock_do_not_rev_lookup_set ( VALUE  self,
VALUE  val 
) [static]

Definition at line 732 of file basicsocket.c.

References rsock_do_not_reverse_lookup, and RTEST.

Referenced by rsock_init_basicsocket().

static VALUE bsock_do_not_reverse_lookup ( VALUE  sock  )  [static]

Definition at line 590 of file basicsocket.c.

References FMODE_NOREVLOOKUP, GetOpenFile, rb_io_t::mode, Qfalse, and Qtrue.

Referenced by rsock_init_basicsocket().

static VALUE bsock_do_not_reverse_lookup_set ( VALUE  sock,
VALUE  state 
) [static]

Definition at line 611 of file basicsocket.c.

References FMODE_NOREVLOOKUP, GetOpenFile, rb_io_t::mode, and RTEST.

Referenced by rsock_init_basicsocket().

static VALUE bsock_getpeername ( VALUE  sock  )  [static]

Definition at line 386 of file basicsocket.c.

References buf, rb_io_t::fd, GetOpenFile, len, rb_str_new(), and rb_sys_fail().

Referenced by rsock_init_basicsocket().

static VALUE bsock_getsockname ( VALUE  sock  )  [static]

Definition at line 355 of file basicsocket.c.

References buf, rb_io_t::fd, GetOpenFile, len, rb_str_new(), and rb_sys_fail().

Referenced by rsock_init_basicsocket().

static VALUE bsock_getsockopt ( VALUE  sock,
VALUE  lev,
VALUE  optname 
) [static]

Definition at line 315 of file basicsocket.c.

References ALLOCA_N, buf, rb_io_t::fd, GetOpenFile, len, level, rb_io_t::pathv, rb_io_check_closed(), rb_str_new(), rsock_getfamily(), rsock_level_arg(), rsock_optname_arg(), rsock_sockopt_new(), and rsock_sys_fail_path().

Referenced by rsock_init_basicsocket().

static VALUE bsock_local_address ( VALUE  sock  )  [static]

Definition at line 476 of file basicsocket.c.

References buf, rb_io_t::fd, GetOpenFile, rb_sys_fail(), and rsock_fd_socket_addrinfo().

Referenced by rsock_init_basicsocket().

static VALUE bsock_recv ( int  argc,
VALUE *  argv,
VALUE  sock 
) [static]

Definition at line 645 of file basicsocket.c.

References RECV_RECV, and rsock_s_recvfrom().

Referenced by rsock_init_basicsocket().

static VALUE bsock_recv_nonblock ( int  argc,
VALUE *  argv,
VALUE  sock 
) [static]

Definition at line 696 of file basicsocket.c.

References RECV_RECV, and rsock_s_recvfrom_nonblock().

Referenced by rsock_init_basicsocket().

static VALUE bsock_remote_address ( VALUE  sock  )  [static]

Definition at line 510 of file basicsocket.c.

References buf, rb_io_t::fd, GetOpenFile, rb_sys_fail(), and rsock_fd_socket_addrinfo().

Referenced by rsock_init_basicsocket().

static VALUE bsock_s_for_fd ( VALUE  klass,
VALUE  fd 
) [static]

Definition at line 25 of file basicsocket.c.

References GetOpenFile, NUM2INT, rb_obj_alloc(), rsock_init_sock(), and VALUE.

Referenced by rsock_init_basicsocket().

static VALUE bsock_setsockopt ( int  argc,
VALUE *  argv,
VALUE  sock 
) [static]

Definition at line 207 of file basicsocket.c.

References rb_io_t::fd, FIX2INT, GetOpenFile, INT2FIX, level, rb_io_t::pathv, rb_funcall(), rb_intern, rb_io_check_closed(), rb_scan_args(), rb_secure(), rsock_getfamily(), rsock_level_arg(), rsock_optname_arg(), rsock_sys_fail_path(), RSTRING_PTR, RSTRING_SOCKLEN, StringValue, T_FALSE, T_FIXNUM, T_TRUE, TYPE, val, and VALUE.

Referenced by rsock_init_basicsocket().

static VALUE bsock_shutdown ( int  argc,
VALUE *  argv,
VALUE  sock 
) [static]

Definition at line 63 of file basicsocket.c.

References rb_io_t::fd, GetOpenFile, INT2FIX, OBJ_TAINTED, Qnil, rb_eArgError, rb_eSecurityError, rb_raise(), rb_safe_level, rb_scan_args(), rb_sys_fail(), rsock_shutdown_how_arg(), SHUT_RD, SHUT_RDWR, SHUT_WR, shutdown, and VALUE.

Referenced by rsock_init_basicsocket().

VALUE rsock_bsock_send ( int  argc,
VALUE *  argv,
VALUE  sock 
)

Definition at line 542 of file basicsocket.c.

References BLOCKING_REGION_FD, rsock_send_arg::fd, rb_io_t::fd, rsock_send_arg::flags, func, GetOpenFile, INT2FIX, rsock_send_arg::mesg, NIL_P, NUM2INT, rb_io_wait_writable(), rb_scan_args(), rb_str_new4, rb_sys_fail(), rb_thread_fd_writable(), rsock_send_blocking(), rsock_sendto_blocking(), RSTRING_PTR, RSTRING_SOCKLEN, SockAddrStringValue, StringValue, rsock_send_arg::to, rsock_send_arg::tolen, and VALUE.

Referenced by rsock_init_basicsocket(), and udp_send().

void rsock_init_basicsocket ( void   ) 

Definition at line 739 of file basicsocket.c.

References bsock_close_read(), bsock_close_write(), bsock_do_not_rev_lookup(), bsock_do_not_rev_lookup_set(), bsock_do_not_reverse_lookup(), bsock_do_not_reverse_lookup_set(), bsock_getpeereid, bsock_getpeername(), bsock_getsockname(), bsock_getsockopt(), bsock_local_address(), bsock_recv(), bsock_recv_nonblock(), bsock_remote_address(), bsock_s_for_fd(), bsock_setsockopt(), bsock_shutdown(), rb_cBasicSocket, rb_cIO, rb_define_class(), rb_define_method(), rb_define_singleton_method(), rb_undef_method(), rsock_bsock_recvmsg, rsock_bsock_recvmsg_nonblock, rsock_bsock_send(), rsock_bsock_sendmsg, and rsock_bsock_sendmsg_nonblock.

Referenced by Init_socket().


Generated on 19 Jul 2016 for Ruby by  doxygen 1.4.7