ext/socket/udpsocket.c File Reference

#include "rubysocket.h"

Go to the source code of this file.

Data Structures

struct  udp_arg

Functions

static VALUE udp_init (int argc, VALUE *argv, VALUE sock)
static VALUE udp_connect_internal (struct udp_arg *arg)
static VALUE udp_connect (VALUE sock, VALUE host, VALUE port)
static VALUE udp_bind (VALUE sock, VALUE host, VALUE port)
static VALUE udp_send (int argc, VALUE *argv, VALUE sock)
static VALUE udp_recvfrom_nonblock (int argc, VALUE *argv, VALUE sock)
void rsock_init_udpsocket (void)


Function Documentation

void rsock_init_udpsocket ( void   ) 

Definition at line 251 of file udpsocket.c.

References rb_cIPSocket, rb_cUDPSocket, rb_define_class(), rb_define_method(), udp_bind(), udp_connect(), udp_init(), udp_recvfrom_nonblock(), and udp_send().

Referenced by rsock_init_socket_init().

static VALUE udp_bind ( VALUE  sock,
VALUE  host,
VALUE  port 
) [static]

Definition at line 111 of file udpsocket.c.

References rb_addrinfo::ai, addrinfo::ai_addr, addrinfo::ai_addrlen, addrinfo::ai_next, rb_io_t::fd, GetOpenFile, INT2FIX, rb_freeaddrinfo(), rb_secure(), rsock_addrinfo(), and rsock_sys_fail_host_port().

Referenced by rsock_init_udpsocket().

static VALUE udp_connect ( VALUE  sock,
VALUE  host,
VALUE  port 
) [static]

Definition at line 82 of file udpsocket.c.

References rb_io_t::fd, udp_arg::fd, GetOpenFile, INT2FIX, rb_ensure(), rb_secure(), udp_arg::res, rsock_addrinfo(), rsock_freeaddrinfo(), rsock_sys_fail_host_port(), udp_connect_internal(), and VALUE.

Referenced by rsock_init_udpsocket().

static VALUE udp_connect_internal ( struct udp_arg arg  )  [static]

Definition at line 52 of file udpsocket.c.

References rb_addrinfo::ai, addrinfo::ai_addr, addrinfo::ai_addrlen, addrinfo::ai_next, udp_arg::fd, Qfalse, Qtrue, udp_arg::res, and rsock_connect().

Referenced by udp_connect().

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

Definition at line 27 of file udpsocket.c.

References rb_scan_args(), rb_secure(), rb_sys_fail(), rsock_family_arg(), rsock_init_sock(), rsock_socket(), and VALUE.

Referenced by rsock_init_udpsocket().

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

Definition at line 245 of file udpsocket.c.

References RECV_IP, and rsock_s_recvfrom_nonblock().

Referenced by rsock_init_udpsocket().

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

Definition at line 157 of file udpsocket.c.

References rb_addrinfo::ai, addrinfo::ai_addr, addrinfo::ai_addrlen, addrinfo::ai_next, BLOCKING_REGION_FD, rb_io_t::fd, rsock_send_arg::fd, rsock_send_arg::flags, GetOpenFile, INT2FIX, rsock_send_arg::mesg, NUM2INT, rb_freeaddrinfo(), rb_io_wait_writable(), rb_scan_args(), rb_thread_fd_writable(), rsock_addrinfo(), rsock_bsock_send(), rsock_sendto_blocking(), rsock_sys_fail_host_port(), StringValue, rsock_send_arg::to, rsock_send_arg::tolen, and VALUE.

Referenced by rsock_init_udpsocket().


Generated on 19 Jul 2016 for Ruby by  doxygen 1.4.7