Ruby 2.7.0p0(2019-12-25revision647ee6f091eafcce70ffb75ddf7e121e192ab217)

Macros | Functions
socket.c File Reference
`#include "rubysocket.h"`

Go to the source code of this file.

## Macros
#define | rsock_sock_s_socketpair rb_f_notimplement
#define | sock_gethostname rb_f_notimplement
#define | socket_s_ip_address_list rb_f_notimplement

## Functions
void | rsock_sys_fail_host_port (const char *mesg, VALUE host, VALUE port)
void | rsock_syserr_fail_host_port (int err, const char *mesg, VALUE host, VALUE port)
void | rsock_sys_fail_path (const char *mesg, VALUE path)
void | rsock_syserr_fail_path (int err, const char *mesg, VALUE path)
void | rsock_sys_fail_sockaddr (const char *mesg, struct sockaddr *addr, socklen_t len)
void | rsock_syserr_fail_sockaddr (int err, const char *mesg, struct sockaddr *addr, socklen_t len)
void | rsock_sys_fail_raddrinfo (const char *mesg, VALUE rai)
void | rsock_syserr_fail_raddrinfo (int err, const char *mesg, VALUE rai)
void | rsock_sys_fail_raddrinfo_or_sockaddr (const char *mesg, VALUE addr, VALUE rai)
void | rsock_syserr_fail_raddrinfo_or_sockaddr (int err, const char *mesg, VALUE addr, VALUE rai)
VALUE | rsock_sock_listen (VALUE sock, VALUE log)
void | Init_socket (void)

## Macro Definition Documentation

## ◆ rsock_sock_s_socketpair

#define rsock_sock_s_socketpair rb_f_notimplement

Definition at line 317 of file socket.c.

## ◆ sock_gethostname

#define sock_gethostname rb_f_notimplement

Definition at line 941 of file socket.c.

## ◆ socket_s_ip_address_list

#define socket_s_ip_address_list rb_f_notimplement

Definition at line 1933 of file socket.c.

## Function Documentation

## ◆ Init_socket()

void Init_socket | ( | void |  | ) |

Definition at line 1937 of file socket.c.

References rb_cBasicSocket, rb_cSocket, rb_define_class(), rb_define_method(), rsock_init_basicsocket(), and rsock_init_socket_init().

## ◆ rsock_sock_listen()

VALUE rsock_sock_listen | ( | VALUE | sock,
|  | VALUE | log
| ) |  |

Definition at line 653 of file socket.c.

References rb_io_t::fd, GetOpenFile, INT2FIX, log(), NUM2INT, and rb_sys_fail().

Referenced by rsock_init_unixserver().

## ◆ rsock_sys_fail_host_port()

void rsock_sys_fail_host_port | ( | const char * | mesg,
|  | VALUE | host,
|  | VALUE | port
| ) |  |

Definition at line 18 of file socket.c.

References errno, and rsock_syserr_fail_host_port().

## ◆ rsock_sys_fail_path()

void rsock_sys_fail_path | ( | const char * | mesg,
|  | VALUE | path
| ) |  |

Definition at line 35 of file socket.c.

References errno, path, and rsock_syserr_fail_path().

## ◆ rsock_sys_fail_raddrinfo()

void rsock_sys_fail_raddrinfo | ( | const char * | mesg,
|  | VALUE | rai
| ) |  |

Definition at line 71 of file socket.c.

References errno, and rsock_syserr_fail_raddrinfo().

## ◆ rsock_sys_fail_raddrinfo_or_sockaddr()

void rsock_sys_fail_raddrinfo_or_sockaddr | ( | const char * | mesg,
|  | VALUE | addr,
|  | VALUE | rai
| ) |  |

Definition at line 88 of file socket.c.

References errno, and rsock_syserr_fail_raddrinfo_or_sockaddr().

## ◆ rsock_sys_fail_sockaddr()

void rsock_sys_fail_sockaddr | ( | const char * | mesg,
|  | struct sockaddr * | addr,
|  | socklen_t | len
| ) |  |

Definition at line 55 of file socket.c.

References errno, len, and rsock_syserr_fail_sockaddr().

## ◆ rsock_syserr_fail_host_port()

void rsock_syserr_fail_host_port | ( | int | err,
|  | const char * | mesg,
|  | VALUE | host,
|  | VALUE | port
| ) |  |

Definition at line 24 of file socket.c.

References err, PRIsVALUE, rb_sprintf(), and rb_syserr_fail_str().

Referenced by rsock_sys_fail_host_port().

## ◆ rsock_syserr_fail_path()

void rsock_syserr_fail_path | ( | int | err,
|  | const char * | mesg,
|  | VALUE | path
| ) |  |

Definition at line 41 of file socket.c.

References err, path, PRIsVALUE, rb_sprintf(), rb_syserr_fail(), rb_syserr_fail_str(), RB_TYPE_P, and T_STRING.

Referenced by rsock_sys_fail_path().

## ◆ rsock_syserr_fail_raddrinfo()

void rsock_syserr_fail_raddrinfo | ( | int | err,
|  | const char * | mesg,
|  | VALUE | rai
| ) |  |

Definition at line 77 of file socket.c.

References err, PRIsVALUE, rb_sprintf(), rb_syserr_fail_str(), rsock_addrinfo_inspect_sockaddr(), and str.

Referenced by rsock_sys_fail_raddrinfo(), rsock_syserr_fail_raddrinfo_or_sockaddr(), and rsock_syserr_fail_sockaddr().

## ◆ rsock_syserr_fail_raddrinfo_or_sockaddr()

void rsock_syserr_fail_raddrinfo_or_sockaddr | ( | int | err,
|  | const char * | mesg,
|  | VALUE | addr,
|  | VALUE | rai
| ) |  |

Definition at line 94 of file socket.c.

References err, NIL_P, rsock_syserr_fail_raddrinfo(), rsock_syserr_fail_sockaddr(), RSTRING_LEN, RSTRING_PTR, and StringValue().

Referenced by rsock_sys_fail_raddrinfo_or_sockaddr().

## ◆ rsock_syserr_fail_sockaddr()

void rsock_syserr_fail_sockaddr | ( | int | err,
|  | const char * | mesg,
|  | struct sockaddr * | addr,
|  | socklen_t | len
| ) |  |

Definition at line 61 of file socket.c.

References err, len, PF_UNSPEC, Qnil, rsock_addrinfo_new(), and rsock_syserr_fail_raddrinfo().

Referenced by rsock_sys_fail_sockaddr(), and rsock_syserr_fail_raddrinfo_or_sockaddr().