Data Structures | Defines | Functions | Variables

ext/socket/init.c File Reference

#include "rubysocket.h"
Include dependency graph for init.c:

Go to the source code of this file.

Data Structures

struct  recvfrom_arg
struct  wait_connectable_arg
struct  connect_arg
struct  accept_arg

Defines

#define WAIT_IN_PROGRESS   1

Functions

void rsock_raise_socket_error (const char *reason, int error)
VALUE rsock_init_sock (VALUE sock, int fd)
VALUE rsock_sendto_blocking (void *data)
VALUE rsock_send_blocking (void *data)
static VALUE recvfrom_blocking (void *data)
VALUE rsock_s_recvfrom (VALUE sock, int argc, VALUE *argv, enum sock_recv_type from)
VALUE rsock_s_recvfrom_nonblock (VALUE sock, int argc, VALUE *argv, enum sock_recv_type from)
int rsock_socket (int domain, int type, int proto)
static int wait_connectable0 (int fd, rb_fdset_t *fds_w, rb_fdset_t *fds_e)
static int wait_connectable (int fd)
static VALUE connect_blocking (void *data)
int rsock_connect (int fd, const struct sockaddr *sockaddr, int len, int socks)
static void make_fd_nonblock (int fd)
VALUE rsock_s_accept_nonblock (VALUE klass, rb_io_t *fptr, struct sockaddr *sockaddr, socklen_t *len)
static VALUE accept_blocking (void *data)
VALUE rsock_s_accept (VALUE klass, int fd, struct sockaddr *sockaddr, socklen_t *len)
int rsock_getfamily (int sockfd)
void rsock_init_socket_init ()

Variables

VALUE rb_cBasicSocket
VALUE rb_cIPSocket
VALUE rb_cTCPSocket
VALUE rb_cTCPServer
VALUE rb_cUDPSocket
VALUE rb_cSocket
VALUE rb_cAddrinfo
VALUE rb_eSocket
int rsock_do_not_reverse_lookup = 1

Define Documentation

#define WAIT_IN_PROGRESS   1

Definition at line 339 of file init.c.


Function Documentation

static VALUE accept_blocking ( void *  data  )  [static]

Definition at line 505 of file init.c.

References accept_arg::fd, accept_arg::len, and accept_arg::sockaddr.

Referenced by rsock_s_accept().

static VALUE connect_blocking ( void *  data  )  [static]

Definition at line 349 of file init.c.

References connect_arg::fd, connect_arg::len, and connect_arg::sockaddr.

static void make_fd_nonblock ( int  fd  )  [static]

Definition at line 455 of file init.c.

References F_SETFL, fcntl(), and rb_sys_fail().

Referenced by rsock_s_accept_nonblock().

static VALUE recvfrom_blocking ( void *  data  )  [static]
int rsock_connect ( int  fd,
const struct sockaddr *  sockaddr,
int  len,
int  socks 
)
int rsock_getfamily ( int  sockfd  ) 

Definition at line 545 of file init.c.

References AF_UNSPEC, and sockaddr_storage::ss_family.

Referenced by bsock_getsockopt(), and bsock_setsockopt().

VALUE rsock_init_sock ( VALUE  sock,
int  fd 
)
void rsock_init_socket_init ( void   ) 
void rsock_raise_socket_error ( const char *  reason,
int  error 
)
VALUE rsock_s_accept ( VALUE  klass,
int  fd,
struct sockaddr *  sockaddr,
socklen_t *  len 
)
VALUE rsock_s_accept_nonblock ( VALUE  klass,
rb_io_t fptr,
struct sockaddr *  sockaddr,
socklen_t *  len 
)
VALUE rsock_s_recvfrom ( VALUE  sock,
int  argc,
VALUE argv,
enum sock_recv_type  from 
)
VALUE rsock_s_recvfrom_nonblock ( VALUE  sock,
int  argc,
VALUE argv,
enum sock_recv_type  from 
)
VALUE rsock_send_blocking ( void *  data  ) 
VALUE rsock_sendto_blocking ( void *  data  ) 
int rsock_socket ( int  domain,
int  type,
int  proto 
)

Definition at line 242 of file init.c.

References errno, and rb_gc().

Referenced by init_inetsock_internal(), sock_initialize(), and udp_init().

static int wait_connectable ( int  fd  )  [static]
static int wait_connectable0 ( int  fd,
rb_fdset_t fds_w,
rb_fdset_t fds_e 
) [static]

Definition at line 257 of file init.c.

References errno, rb_fd_isset, rb_fd_ptr, rb_fd_set, rb_fd_zero, and rb_thread_select().

Referenced by wait_connectable().


Variable Documentation

Definition at line 23 of file init.c.

Referenced by rsock_addrinfo_new(), and rsock_init_addrinfo().

Definition at line 14 of file init.c.

Referenced by rsock_init_ipsocket(), rsock_init_tcpsocket(), and rsock_init_udpsocket().

Definition at line 16 of file init.c.

Referenced by rsock_init_tcpserver().

Definition at line 17 of file init.c.

Referenced by rsock_init_udpsocket().