Ruby  2.0.0p247(2013-06-27revision41674)
Defines | Functions
ext/socket/socket.c File Reference
#include "rubysocket.h"

Go to the source code of this file.

Defines

#define rsock_sock_s_socketpair   rb_f_notimplement
#define sock_gethostname   rb_f_notimplement
#define socket_s_ip_address_list   rb_f_notimplement

Functions

static void setup_domain_and_type (VALUE domain, int *dv, VALUE type, int *tv)
static VALUE sock_initialize (int argc, VALUE *argv, VALUE sock)
static VALUE sock_connect (VALUE sock, VALUE addr)
static VALUE sock_connect_nonblock (VALUE sock, VALUE addr)
static VALUE sock_bind (VALUE sock, VALUE addr)
VALUE rsock_sock_listen (VALUE sock, VALUE log)
static VALUE sock_recvfrom (int argc, VALUE *argv, VALUE sock)
static VALUE sock_recvfrom_nonblock (int argc, VALUE *argv, VALUE sock)
static VALUE sock_accept (VALUE sock)
static VALUE sock_accept_nonblock (VALUE sock)
static VALUE sock_sysaccept (VALUE sock)
static VALUE make_addrinfo (struct addrinfo *res0, int norevlookup)
static VALUE sock_sockaddr (struct sockaddr *addr, size_t len)
static VALUE sock_s_gethostbyname (VALUE obj, VALUE host)
static VALUE sock_s_gethostbyaddr (int argc, VALUE *argv)
static VALUE sock_s_getservbyname (int argc, VALUE *argv)
static VALUE sock_s_getservbyport (int argc, VALUE *argv)
static VALUE sock_s_getaddrinfo (int argc, VALUE *argv)
static VALUE sock_s_getnameinfo (int argc, VALUE *argv)
static VALUE sock_s_pack_sockaddr_in (VALUE self, VALUE port, VALUE host)
static VALUE sock_s_unpack_sockaddr_in (VALUE self, VALUE addr)
void Init_socket ()

Define Documentation

Definition at line 182 of file socket.c.

Referenced by Init_socket().

Definition at line 925 of file socket.c.

Referenced by Init_socket().

Definition at line 1833 of file socket.c.

Referenced by Init_socket().


Function Documentation

void Init_socket ( )
static VALUE make_addrinfo ( struct addrinfo res0,
int  norevlookup 
) [static]
VALUE rsock_sock_listen ( VALUE  sock,
VALUE  log 
)
static void setup_domain_and_type ( VALUE  domain,
int *  dv,
VALUE  type,
int *  tv 
) [static]

Definition at line 14 of file socket.c.

References rsock_family_arg(), and rsock_socktype_arg().

Referenced by sock_initialize().

static VALUE sock_accept ( VALUE  sock) [static]
static VALUE sock_accept_nonblock ( VALUE  sock) [static]
static VALUE sock_bind ( VALUE  sock,
VALUE  addr 
) [static]

Definition at line 463 of file socket.c.

References rb_io_t::fd, GetOpenFile, INT2FIX, rb_sys_fail(), RSTRING_LENINT, RSTRING_PTR, and SockAddrStringValue.

Referenced by Init_socket().

static VALUE sock_connect ( VALUE  sock,
VALUE  addr 
) [static]
static VALUE sock_connect_nonblock ( VALUE  sock,
VALUE  addr 
) [static]
static VALUE sock_initialize ( int  argc,
VALUE argv,
VALUE  sock 
) [static]
static VALUE sock_recvfrom ( int  argc,
VALUE argv,
VALUE  sock 
) [static]

Definition at line 666 of file socket.c.

References RECV_SOCKET, and rsock_s_recvfrom().

Referenced by Init_socket().

static VALUE sock_recvfrom_nonblock ( int  argc,
VALUE argv,
VALUE  sock 
) [static]

Definition at line 734 of file socket.c.

References RECV_SOCKET, and rsock_s_recvfrom_nonblock().

Referenced by Init_socket().

static VALUE sock_s_getaddrinfo ( int  argc,
VALUE argv 
) [static]
static VALUE sock_s_gethostbyaddr ( int  argc,
VALUE argv 
) [static]
static VALUE sock_s_gethostbyname ( VALUE  obj,
VALUE  host 
) [static]

Definition at line 985 of file socket.c.

References AI_CANONNAME, Qnil, rb_secure(), rsock_addrinfo(), rsock_make_hostent(), and sock_sockaddr().

Referenced by Init_socket().

static VALUE sock_s_getnameinfo ( int  argc,
VALUE argv 
) [static]
static VALUE sock_s_getservbyname ( int  argc,
VALUE argv 
) [static]

Definition at line 1063 of file socket.c.

References INT2FIX, NIL_P, proto, rb_eSocket, rb_raise(), rb_scan_args(), StringValue, StringValueCStr, and STRTOUL.

Referenced by Init_socket().

static VALUE sock_s_getservbyport ( int  argc,
VALUE argv 
) [static]
static VALUE sock_s_pack_sockaddr_in ( VALUE  self,
VALUE  port,
VALUE  host 
) [static]
static VALUE sock_s_unpack_sockaddr_in ( VALUE  self,
VALUE  addr 
) [static]
static VALUE sock_sockaddr ( struct sockaddr *  addr,
size_t  len 
) [static]

Definition at line 953 of file socket.c.

References rb_eSocket, rb_raise(), and rb_str_new().

Referenced by sock_s_gethostbyname().

static VALUE sock_sysaccept ( VALUE  sock) [static]

Definition at line 870 of file socket.c.

References rb_io_t::fd, GetOpenFile, rb_assoc_new(), rsock_io_socket_addrinfo(), and rsock_s_accept().

Referenced by Init_socket().