maph 1.0.0 High-Performance Memory-Mapped Key-Value Database with O(1) Lookups

Loading...
Searching...
No Matches
Classes | Macros | Enumerations | Functions
libusockets.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

## Classes
struct | us_socket_context_options_t

## Macros
#define | LIBUS_RECV_BUFFER_LENGTH 524288
#define | LIBUS_TIMEOUT_GRANULARITY 4
#define | LIBUS_RECV_BUFFER_PADDING 32
#define | LIBUS_EXT_ALIGNMENT 16
#define | LIBUS_SOCKET_DESCRIPTOR int
#define | LIBUS_USE_EPOLL

## Enumerations
enum | { LIBUS_LISTEN_DEFAULT , LIBUS_LISTEN_EXCLUSIVE_PORT }

## Functions
char * | us_udp_packet_buffer_payload (struct us_udp_packet_buffer_t *buf, int index)
int | us_udp_packet_buffer_payload_length (struct us_udp_packet_buffer_t *buf, int index)
int | us_udp_packet_buffer_local_ip (struct us_udp_packet_buffer_t *buf, int index, char *ip)
int | us_udp_socket_bound_port (struct us_udp_socket_t *s)
char * | us_udp_packet_buffer_peer (struct us_udp_packet_buffer_t *buf, int index)
int | us_udp_packet_buffer_ecn (struct us_udp_packet_buffer_t *buf, int index)
int | us_udp_socket_receive (struct us_udp_socket_t *s, struct us_udp_packet_buffer_t *buf)
void | us_udp_buffer_set_packet_payload (struct us_udp_packet_buffer_t *send_buf, int index, int offset, void *payload, int length, void *peer_addr)
int | us_udp_socket_send (struct us_udp_socket_t *s, struct us_udp_packet_buffer_t *buf, int num)
struct us_udp_packet_buffer_t * | us_create_udp_packet_buffer ()
struct us_udp_socket_t * | us_create_udp_socket (struct us_loop_t *loop, struct us_udp_packet_buffer_t *buf, void(*data_cb)(struct us_udp_socket_t *, struct us_udp_packet_buffer_t *, int), void(*drain_cb)(struct us_udp_socket_t *), const char *host, unsigned short port, void *user)
void * | us_udp_socket_user (struct us_udp_socket_t *s)
int | us_udp_socket_bind (struct us_udp_socket_t *s, const char *hostname, unsigned int port)
struct us_timer_t * | us_create_timer (struct us_loop_t *loop, int fallthrough, unsigned int ext_size)
void * | us_timer_ext (struct us_timer_t *timer)
void | us_timer_close (struct us_timer_t *timer)
void | us_timer_set (struct us_timer_t *timer, void(*cb)(struct us_timer_t *t), int ms, int repeat_ms)
struct us_loop_t * | us_timer_loop (struct us_timer_t *t)
unsigned short | us_socket_context_timestamp (int ssl, struct us_socket_context_t *context)
void | us_socket_context_add_server_name (int ssl, struct us_socket_context_t *context, const char *hostname_pattern, struct us_socket_context_options_t options, void *user)
void | us_socket_context_remove_server_name (int ssl, struct us_socket_context_t *context, const char *hostname_pattern)
void | us_socket_context_on_server_name (int ssl, struct us_socket_context_t *context, void(*cb)(struct us_socket_context_t *, const char *hostname))
void * | us_socket_server_name_userdata (int ssl, struct us_socket_t *s)
void * | us_socket_context_find_server_name_userdata (int ssl, struct us_socket_context_t *context, const char *hostname_pattern)
void * | us_socket_context_get_native_handle (int ssl, struct us_socket_context_t *context)
struct us_socket_context_t * | us_create_socket_context (int ssl, struct us_loop_t *loop, int ext_size, struct us_socket_context_options_t options)
void | us_socket_context_free (int ssl, struct us_socket_context_t *context)
void | us_socket_context_on_open (int ssl, struct us_socket_context_t *context, struct us_socket_t *(*on_open)(struct us_socket_t *s, int is_client, char *ip, int ip_length))
void | us_socket_context_on_close (int ssl, struct us_socket_context_t *context, struct us_socket_t *(*on_close)(struct us_socket_t *s, int code, void *reason))
void | us_socket_context_on_data (int ssl, struct us_socket_context_t *context, struct us_socket_t *(*on_data)(struct us_socket_t *s, char *data, int length))
void | us_socket_context_on_writable (int ssl, struct us_socket_context_t *context, struct us_socket_t *(*on_writable)(struct us_socket_t *s))
void | us_socket_context_on_timeout (int ssl, struct us_socket_context_t *context, struct us_socket_t *(*on_timeout)(struct us_socket_t *s))
void | us_socket_context_on_long_timeout (int ssl, struct us_socket_context_t *context, struct us_socket_t *(*on_timeout)(struct us_socket_t *s))
void | us_socket_context_on_connect_error (int ssl, struct us_socket_context_t *context, struct us_socket_t *(*on_connect_error)(struct us_socket_t *s, int code))
void | us_socket_context_on_end (int ssl, struct us_socket_context_t *context, struct us_socket_t *(*on_end)(struct us_socket_t *s))
void * | us_socket_context_ext (int ssl, struct us_socket_context_t *context)
void | us_socket_context_close (int ssl, struct us_socket_context_t *context)
struct us_listen_socket_t * | us_socket_context_listen (int ssl, struct us_socket_context_t *context, const char *host, int port, int options, int socket_ext_size)
struct us_listen_socket_t * | us_socket_context_listen_unix (int ssl, struct us_socket_context_t *context, const char *path, int options, int socket_ext_size)
void | us_listen_socket_close (int ssl, struct us_listen_socket_t *ls)
struct us_socket_t * | us_socket_context_connect (int ssl, struct us_socket_context_t *context, const char *host, int port, const char *source_host, int options, int socket_ext_size)
struct us_socket_t * | us_socket_context_connect_unix (int ssl, struct us_socket_context_t *context, const char *server_path, int options, int socket_ext_size)
int | us_socket_is_established (int ssl, struct us_socket_t *s)
struct us_socket_t * | us_socket_close_connecting (int ssl, struct us_socket_t *s)
struct us_loop_t * | us_socket_context_loop (int ssl, struct us_socket_context_t *context)
struct us_socket_t * | us_socket_context_adopt_socket (int ssl, struct us_socket_context_t *context, struct us_socket_t *s, int ext_size)
struct us_socket_context_t * | us_create_child_socket_context (int ssl, struct us_socket_context_t *context, int context_ext_size)
struct us_loop_t * | us_create_loop (void *hint, void(*wakeup_cb)(struct us_loop_t *loop), void(*pre_cb)(struct us_loop_t *loop), void(*post_cb)(struct us_loop_t *loop), unsigned int ext_size)
void | us_loop_free (struct us_loop_t *loop)
void * | us_loop_ext (struct us_loop_t *loop)
void | us_loop_run (struct us_loop_t *loop)
void | us_wakeup_loop (struct us_loop_t *loop)
void | us_loop_integrate (struct us_loop_t *loop)
long long | us_loop_iteration_number (struct us_loop_t *loop)
struct us_poll_t * | us_create_poll (struct us_loop_t *loop, int fallthrough, unsigned int ext_size)
void | us_poll_free (struct us_poll_t *p, struct us_loop_t *loop)
void | us_poll_init (struct us_poll_t *p, int fd, int poll_type)
void | us_poll_start (struct us_poll_t *p, struct us_loop_t *loop, int events)
void | us_poll_change (struct us_poll_t *p, struct us_loop_t *loop, int events)
void | us_poll_stop (struct us_poll_t *p, struct us_loop_t *loop)
int | us_poll_events (struct us_poll_t *p)
void * | us_poll_ext (struct us_poll_t *p)
int | us_poll_fd (struct us_poll_t *p)
struct us_poll_t * | us_poll_resize (struct us_poll_t *p, struct us_loop_t *loop, unsigned int ext_size)
void * | us_socket_get_native_handle (int ssl, struct us_socket_t *s)
int | us_socket_write (int ssl, struct us_socket_t *s, const char *data, int length, int msg_more)
void | us_socket_timeout (int ssl, struct us_socket_t *s, unsigned int seconds)
void | us_socket_long_timeout (int ssl, struct us_socket_t *s, unsigned int minutes)
void * | us_socket_ext (int ssl, struct us_socket_t *s)
struct us_socket_context_t * | us_socket_context (int ssl, struct us_socket_t *s)
void | us_socket_flush (int ssl, struct us_socket_t *s)
void | us_socket_shutdown (int ssl, struct us_socket_t *s)
void | us_socket_shutdown_read (int ssl, struct us_socket_t *s)
int | us_socket_is_shut_down (int ssl, struct us_socket_t *s)
int | us_socket_is_closed (int ssl, struct us_socket_t *s)
struct us_socket_t * | us_socket_close (int ssl, struct us_socket_t *s, int code, void *reason)
int | us_socket_local_port (int ssl, struct us_socket_t *s)
void | us_socket_remote_address (int ssl, struct us_socket_t *s, char *buf, int *length)

## Class Documentation

## ◆ us_socket_context_options_t

struct us_socket_context_options_t

Definition at line 124 of file libusockets.h.

Collaboration diagram for us_socket_context_options_t:

Class Members
const char * | ca_file_name |
const char * | cert_file_name |
const char * | dh_params_file_name |
const char * | key_file_name |
const char * | passphrase |
const char * | ssl_ciphers |
int | ssl_prefer_low_memory_usage |

## Macro Definition Documentation

## ◆ LIBUS_EXT_ALIGNMENT

#define LIBUS_EXT_ALIGNMENT 16

Definition at line 28 of file libusockets.h.

## ◆ LIBUS_RECV_BUFFER_LENGTH

#define LIBUS_RECV_BUFFER_LENGTH 524288

Definition at line 22 of file libusockets.h.

## ◆ LIBUS_RECV_BUFFER_PADDING

#define LIBUS_RECV_BUFFER_PADDING 32

Definition at line 26 of file libusockets.h.

## ◆ LIBUS_SOCKET_DESCRIPTOR

#define LIBUS_SOCKET_DESCRIPTOR int

Definition at line 38 of file libusockets.h.

## ◆ LIBUS_TIMEOUT_GRANULARITY

#define LIBUS_TIMEOUT_GRANULARITY 4

Definition at line 24 of file libusockets.h.

## ◆ LIBUS_USE_EPOLL

#define LIBUS_USE_EPOLL

Definition at line 331 of file libusockets.h.

## Enumeration Type Documentation

## ◆ anonymous enum

anonymous enum

Enumerator
LIBUS_LISTEN_DEFAULT |
LIBUS_LISTEN_EXCLUSIVE_PORT |

Definition at line 45 of file libusockets.h.

## Function Documentation

## ◆ us_create_child_socket_context()

struct us_socket_context_t * us_create_child_socket_context | ( | int | ssl,
|  | struct us_socket_context_t * | context,
|  | int | context_ext_size
| ) |  |

Definition at line 368 of file context.c.

References us_socket_context_t::loop, us_create_socket_context(), and us_internal_create_child_ssl_socket_context().

Here is the call graph for this function:

## ◆ us_create_loop()

struct us_loop_t * us_create_loop | ( | void * | hint,
|  | void(*)(struct us_loop_t *loop) | wakeup_cb,
|  | void(*)(struct us_loop_t *loop) | pre_cb,
|  | void(*)(struct us_loop_t *loop) | post_cb,
|  | unsigned int | ext_size
| ) |  |

Referenced by main().

Here is the caller graph for this function:

## ◆ us_create_poll()

struct us_poll_t * us_create_poll | ( | struct us_loop_t * | loop,
|  | int | fallthrough,
|  | unsigned int | ext_size
| ) |  |

Referenced by us_create_udp_socket(), us_internal_dispatch_ready_poll(), us_socket_context_connect(), us_socket_context_connect_unix(), us_socket_context_listen(), and us_socket_context_listen_unix().

Here is the caller graph for this function:

## ◆ us_create_socket_context()

struct us_socket_context_t * us_create_socket_context | ( | int | ssl,
|  | struct us_loop_t * | loop,
|  | int | ext_size,
|  | struct us_socket_context_options_t | options
| ) |  |

Definition at line 202 of file context.c.

References default_is_low_prio_handler(), us_socket_context_t::global_tick, us_socket_context_t::head_listen_sockets, us_socket_context_t::head_sockets, us_socket_context_t::is_low_prio, us_socket_context_t::iterator, us_socket_context_t::long_timestamp, us_socket_context_t::loop, us_socket_context_t::next, us_socket_context_t::timestamp, us_internal_create_ssl_socket_context(), and us_internal_loop_link().

Referenced by main(), and us_create_child_socket_context().

Here is the call graph for this function:
Here is the caller graph for this function:

## ◆ us_create_timer()

struct us_timer_t * us_create_timer | ( | struct us_loop_t * | loop,
|  | int | fallthrough,
|  | unsigned int | ext_size
| ) |  |

Referenced by us_internal_loop_data_init().

Here is the caller graph for this function:

## ◆ us_create_udp_packet_buffer()

struct us_udp_packet_buffer_t * us_create_udp_packet_buffer | ( |  | ) |

Definition at line 63 of file udp.c.

References bsd_create_udp_packet_buffer().

Referenced by us_create_udp_socket().

Here is the call graph for this function:
Here is the caller graph for this function:

## ◆ us_create_udp_socket()

struct us_udp_socket_t * us_create_udp_socket | ( | struct us_loop_t * | loop,
|  | struct us_udp_packet_buffer_t * | buf,
|  | void(*)(struct us_udp_socket_t *, struct us_udp_packet_buffer_t *, int) | data_cb,
|  | void(*)(struct us_udp_socket_t *) | drain_cb,
|  | const char * | host,
|  | unsigned short | port,
|  | void * | user
| ) |  |

Definition at line 104 of file udp.c.

References bsd_addr_get_port(), bsd_create_udp_socket(), bsd_local_addr(), us_internal_callback_t::cb, us_internal_udp_t::cb, us_internal_udp_t::data_cb, us_internal_udp_t::drain_cb, us_poll_t::fd, internal_on_udp_read(), LIBUS_SOCKET_DESCRIPTOR, LIBUS_SOCKET_ERROR, LIBUS_SOCKET_READABLE, POLL_TYPE_CALLBACK, us_internal_udp_t::port, us_internal_udp_t::receive_buf, us_create_poll(), us_create_udp_packet_buffer(), us_poll_init(), us_poll_start(), and us_internal_udp_t::user.

Here is the call graph for this function:

## ◆ us_listen_socket_close()

void us_listen_socket_close | ( | int | ssl,
|  | struct us_listen_socket_t * | ls
| ) |  |

Definition at line 33 of file context.c.

References bsd_close_socket(), us_internal_loop_data_t::closed_head, us_socket_t::context, us_loop_t::data, us_socket_context_t::loop, us_socket_t::next, us_socket_t::prev, us_listen_socket_t::s, us_internal_socket_context_unlink_listen_socket(), us_poll_fd(), us_poll_stop(), and us_socket_is_closed().

Referenced by us_socket_context_close().

Here is the call graph for this function:
Here is the caller graph for this function:

## ◆ us_loop_ext()

void * us_loop_ext | ( | struct us_loop_t * | loop | ) |

Definition at line 360 of file loop.c.

## ◆ us_loop_free()

void us_loop_free | ( | struct us_loop_t * | loop | ) |

## ◆ us_loop_integrate()

void us_loop_integrate | ( | struct us_loop_t * | loop | ) |

Definition at line 356 of file loop.c.

References us_loop_t::data, LIBUS_TIMEOUT_GRANULARITY, us_internal_loop_data_t::sweep_timer, sweep_timer_cb(), and us_timer_set().

Here is the call graph for this function:

## ◆ us_loop_iteration_number()

long long us_loop_iteration_number | ( | struct us_loop_t * | loop | ) |

Definition at line 179 of file loop.c.

References us_loop_t::data, and us_internal_loop_data_t::iteration_nr.

## ◆ us_loop_run()

void us_loop_run | ( | struct us_loop_t * | loop | ) |

Referenced by main().

Here is the caller graph for this function:

## ◆ us_poll_change()

void us_poll_change | ( | struct us_poll_t * | p,
|  | struct us_loop_t * | loop,
|  | int | events
| ) |  |

Referenced by us_internal_dispatch_ready_poll(), us_internal_handle_low_priority_sockets(), us_socket_shutdown(), and us_socket_write().

Here is the caller graph for this function:

## ◆ us_poll_events()

int us_poll_events | ( | struct us_poll_t * | p | ) |

Referenced by us_internal_dispatch_ready_poll(), us_internal_handle_low_priority_sockets(), and us_socket_shutdown().

Here is the caller graph for this function:

## ◆ us_poll_ext()

void * us_poll_ext | ( | struct us_poll_t * | p | ) |

## ◆ us_poll_fd()

int us_poll_fd | ( | struct us_poll_t * | p | ) |

Referenced by us_internal_dispatch_ready_poll(), us_listen_socket_close(), us_socket_close(), us_socket_close_connecting(), us_socket_flush(), us_socket_get_native_handle(), us_socket_local_port(), us_socket_remote_address(), us_socket_shutdown(), us_socket_shutdown_read(), us_socket_write(), us_udp_socket_receive(), and us_udp_socket_send().

Here is the caller graph for this function:

## ◆ us_poll_free()

void us_poll_free | ( | struct us_poll_t * | p,
|  | struct us_loop_t * | loop
| ) |  |

Referenced by us_internal_free_closed_sockets().

Here is the caller graph for this function:

## ◆ us_poll_init()

void us_poll_init | ( | struct us_poll_t * | p,
|  | int | fd,
|  | int | poll_type
| ) |  |

Referenced by us_create_udp_socket(), us_internal_dispatch_ready_poll(), us_socket_context_connect(), us_socket_context_connect_unix(), us_socket_context_listen(), and us_socket_context_listen_unix().

Here is the caller graph for this function:

## ◆ us_poll_resize()

struct us_poll_t * us_poll_resize | ( | struct us_poll_t * | p,
|  | struct us_loop_t * | loop,
|  | unsigned int | ext_size
| ) |  |

Referenced by us_socket_context_adopt_socket().

Here is the caller graph for this function:

## ◆ us_poll_start()

void us_poll_start | ( | struct us_poll_t * | p,
|  | struct us_loop_t * | loop,
|  | int | events
| ) |  |

Referenced by us_create_udp_socket(), us_internal_dispatch_ready_poll(), us_socket_context_connect(), us_socket_context_connect_unix(), us_socket_context_listen(), and us_socket_context_listen_unix().

Here is the caller graph for this function:

## ◆ us_poll_stop()

void us_poll_stop | ( | struct us_poll_t * | p,
|  | struct us_loop_t * | loop
| ) |  |

Referenced by us_listen_socket_close(), us_socket_close(), and us_socket_close_connecting().

Here is the caller graph for this function:

## ◆ us_socket_close()

struct us_socket_t * us_socket_close | ( | int | ssl,
|  | struct us_socket_t * | s,
|  | int | code,
|  | void * | reason
| ) |  |

Definition at line 105 of file socket.c.

References bsd_close_socket(), us_socket_t::context, us_loop_t::data, us_socket_context_t::loop, us_internal_loop_data_t::low_prio_head, us_socket_t::low_prio_state, us_socket_t::next, us_socket_t::prev, us_internal_socket_context_unlink_socket(), us_poll_fd(), us_poll_stop(), and us_socket_is_closed().

Referenced by on_echo_socket_end(), on_echo_socket_timeout(), on_http_socket_end(), on_http_socket_timeout(), us_internal_dispatch_ready_poll(), and us_socket_context_close().

Here is the call graph for this function:
Here is the caller graph for this function:

## ◆ us_socket_close_connecting()

struct us_socket_t * us_socket_close_connecting | ( | int | ssl,
|  | struct us_socket_t * | s
| ) |  |

Definition at line 86 of file socket.c.

References bsd_close_socket(), us_socket_t::context, us_internal_socket_context_unlink_socket(), us_poll_fd(), us_poll_stop(), and us_socket_is_closed().

Referenced by us_internal_dispatch_ready_poll().

Here is the call graph for this function:
Here is the caller graph for this function:

## ◆ us_socket_context()

struct us_socket_context_t * us_socket_context | ( | int | ssl,
|  | struct us_socket_t * | s
| ) |  |

Definition at line 50 of file socket.c.

References us_socket_t::context.

Referenced by on_http_socket_data(), on_http_socket_writable(), us_internal_dispatch_ready_poll(), and us_internal_handle_low_priority_sockets().

Here is the caller graph for this function:

## ◆ us_socket_context_add_server_name()

void us_socket_context_add_server_name | ( | int | ssl,
|  | struct us_socket_context_t * | context,
|  | const char * | hostname_pattern,
|  | struct us_socket_context_options_t | options,
|  | void * | user
| ) |  |

Definition at line 158 of file context.c.

References us_internal_ssl_socket_context_add_server_name().

Here is the call graph for this function:

## ◆ us_socket_context_adopt_socket()

struct us_socket_t * us_socket_context_adopt_socket | ( | int | ssl,
|  | struct us_socket_context_t * | context,
|  | struct us_socket_t * | s,
|  | int | ext_size
| ) |  |

Definition at line 381 of file context.c.

References us_socket_t::context, us_loop_t::data, us_socket_t::long_timeout, us_socket_context_t::loop, us_internal_loop_data_t::low_prio_head, us_socket_t::low_prio_state, us_socket_t::next, us_socket_t::p, us_socket_t::prev, us_socket_t::timeout, us_internal_socket_context_link_socket(), us_internal_socket_context_unlink_socket(), us_internal_ssl_socket_context_adopt_socket(), us_poll_resize(), and us_socket_is_closed().

Here is the call graph for this function:

## ◆ us_socket_context_close()

void us_socket_context_close | ( | int | ssl,
|  | struct us_socket_context_t * | context
| ) |  |

Definition at line 51 of file context.c.

References us_socket_t::context, us_socket_context_t::head_listen_sockets, us_socket_context_t::head_sockets, us_socket_t::next, us_listen_socket_t::s, us_listen_socket_close(), and us_socket_close().

Here is the call graph for this function:

## ◆ us_socket_context_connect()

struct us_socket_t * us_socket_context_connect | ( | int | ssl,
|  | struct us_socket_context_t * | context,
|  | const char * | host,
|  | int | port,
|  | const char * | source_host,
|  | int | options,
|  | int | socket_ext_size
| ) |  |

Definition at line 310 of file context.c.

References bsd_create_connect_socket(), us_socket_t::context, LIBUS_SOCKET_DESCRIPTOR, LIBUS_SOCKET_ERROR, LIBUS_SOCKET_WRITABLE, us_socket_t::long_timeout, us_socket_context_t::loop, us_socket_t::low_prio_state, us_socket_t::p, POLL_TYPE_SEMI_SOCKET, us_socket_t::timeout, us_create_poll(), us_internal_socket_context_link_socket(), us_internal_ssl_socket_context_connect(), us_poll_init(), and us_poll_start().

Here is the call graph for this function:

## ◆ us_socket_context_connect_unix()

struct us_socket_t * us_socket_context_connect_unix | ( | int | ssl,
|  | struct us_socket_context_t * | context,
|  | const char * | server_path,
|  | int | options,
|  | int | socket_ext_size
| ) |  |

Definition at line 339 of file context.c.

References bsd_create_connect_socket_unix(), us_socket_t::context, LIBUS_SOCKET_DESCRIPTOR, LIBUS_SOCKET_ERROR, LIBUS_SOCKET_WRITABLE, us_socket_t::long_timeout, us_socket_context_t::loop, us_socket_t::low_prio_state, us_socket_t::p, POLL_TYPE_SEMI_SOCKET, us_socket_t::timeout, us_create_poll(), us_internal_socket_context_link_socket(), us_internal_ssl_socket_context_connect_unix(), us_poll_init(), and us_poll_start().

Here is the call graph for this function:

## ◆ us_socket_context_ext()

void * us_socket_context_ext | ( | int | ssl,
|  | struct us_socket_context_t * | context
| ) |  |

Definition at line 503 of file context.c.

References us_socket_t::context, and us_internal_ssl_socket_context_ext().

Referenced by main(), on_http_socket_data(), and on_http_socket_writable().

Here is the call graph for this function:
Here is the caller graph for this function:

## ◆ us_socket_context_find_server_name_userdata()

void * us_socket_context_find_server_name_userdata | ( | int | ssl,
|  | struct us_socket_context_t * | context,
|  | const char * | hostname_pattern
| ) |  |

Definition at line 138 of file context.c.

References us_internal_ssl_socket_context_find_server_name_userdata().

Here is the call graph for this function:

## ◆ us_socket_context_free()

void us_socket_context_free | ( | int | ssl,
|  | struct us_socket_context_t * | context
| ) |  |

Definition at line 232 of file context.c.

References us_socket_context_t::loop, us_internal_loop_unlink(), and us_internal_ssl_socket_context_free().

Here is the call graph for this function:

## ◆ us_socket_context_get_native_handle()

void * us_socket_context_get_native_handle | ( | int | ssl,
|  | struct us_socket_context_t * | context
| ) |  |

Definition at line 190 of file context.c.

References us_internal_ssl_socket_context_get_native_handle().

Here is the call graph for this function:

## ◆ us_socket_context_listen()

struct us_listen_socket_t * us_socket_context_listen | ( | int | ssl,
|  | struct us_socket_context_t * | context,
|  | const char * | host,
|  | int | port,
|  | int | options,
|  | int | socket_ext_size
| ) |  |

Definition at line 248 of file context.c.

References bsd_create_listen_socket(), us_socket_t::context, LIBUS_SOCKET_DESCRIPTOR, LIBUS_SOCKET_ERROR, LIBUS_SOCKET_READABLE, us_socket_t::long_timeout, us_socket_context_t::loop, us_socket_t::low_prio_state, us_socket_t::next, POLL_TYPE_SEMI_SOCKET, us_listen_socket_t::s, us_listen_socket_t::socket_ext_size, us_socket_t::timeout, us_create_poll(), us_internal_socket_context_link_listen_socket(), us_internal_ssl_socket_context_listen(), us_poll_init(), and us_poll_start().

Referenced by main().

Here is the call graph for this function:
Here is the caller graph for this function:

## ◆ us_socket_context_listen_unix()

struct us_listen_socket_t * us_socket_context_listen_unix | ( | int | ssl,
|  | struct us_socket_context_t * | context,
|  | const char * | path,
|  | int | options,
|  | int | socket_ext_size
| ) |  |

Definition at line 279 of file context.c.

References bsd_create_listen_socket_unix(), us_socket_t::context, LIBUS_SOCKET_DESCRIPTOR, LIBUS_SOCKET_ERROR, LIBUS_SOCKET_READABLE, us_socket_t::long_timeout, us_socket_context_t::loop, us_socket_t::low_prio_state, us_socket_t::next, POLL_TYPE_SEMI_SOCKET, us_listen_socket_t::s, us_listen_socket_t::socket_ext_size, us_socket_t::timeout, us_create_poll(), us_internal_socket_context_link_listen_socket(), us_internal_ssl_socket_context_listen_unix(), us_poll_init(), and us_poll_start().

Here is the call graph for this function:

## ◆ us_socket_context_loop()

struct us_loop_t * us_socket_context_loop | ( | int | ssl,
|  | struct us_socket_context_t * | context
| ) |  |

Definition at line 131 of file context.c.

References us_socket_context_t::loop.

## ◆ us_socket_context_on_close()

void us_socket_context_on_close | ( | int | ssl,
|  | struct us_socket_context_t * | context,
|  | struct us_socket_t *(*)(struct us_socket_t *s, int code, void *reason) | on_close
| ) |  |

Definition at line 426 of file context.c.

References us_socket_t::context, us_socket_context_t::on_close, and us_internal_ssl_socket_context_on_close().

Referenced by main().

Here is the call graph for this function:
Here is the caller graph for this function:

## ◆ us_socket_context_on_connect_error()

void us_socket_context_on_connect_error | ( | int | ssl,
|  | struct us_socket_context_t * | context,
|  | struct us_socket_t *(*)(struct us_socket_t *s, int code) | on_connect_error
| ) |  |

Definition at line 492 of file context.c.

References us_socket_t::context, us_socket_context_t::on_connect_error, and us_internal_ssl_socket_context_on_connect_error().

Here is the call graph for this function:

## ◆ us_socket_context_on_data()

void us_socket_context_on_data | ( | int | ssl,
|  | struct us_socket_context_t * | context,
|  | struct us_socket_t *(*)(struct us_socket_t *s, char *data, int length) | on_data
| ) |  |

Definition at line 437 of file context.c.

References us_socket_t::context, us_socket_context_t::on_data, and us_internal_ssl_socket_context_on_data().

Referenced by main().

Here is the call graph for this function:
Here is the caller graph for this function:

## ◆ us_socket_context_on_end()

void us_socket_context_on_end | ( | int | ssl,
|  | struct us_socket_context_t * | context,
|  | struct us_socket_t *(*)(struct us_socket_t *s) | on_end
| ) |  |

## ◆ us_socket_context_on_long_timeout()

void us_socket_context_on_long_timeout | ( | int | ssl,
|  | struct us_socket_context_t * | context,
|  | struct us_socket_t *(*)(struct us_socket_t *s) | on_timeout
| ) |  |

## ◆ us_socket_context_on_open()

void us_socket_context_on_open | ( | int | ssl,
|  | struct us_socket_context_t * | context,
|  | struct us_socket_t *(*)(struct us_socket_t *s, int is_client, char *ip, int ip_length) | on_open
| ) |  |

Definition at line 415 of file context.c.

References us_socket_t::context, us_socket_context_t::on_open, and us_internal_ssl_socket_context_on_open().

Referenced by main().

Here is the call graph for this function:
Here is the caller graph for this function:

## ◆ us_socket_context_on_server_name()

void us_socket_context_on_server_name | ( | int | ssl,
|  | struct us_socket_context_t * | context,
|  | void(*)(struct us_socket_context_t *, const char *hostname) | cb
| ) |  |

Definition at line 180 of file context.c.

References us_internal_ssl_socket_context_on_server_name().

Here is the call graph for this function:

## ◆ us_socket_context_on_timeout()

void us_socket_context_on_timeout | ( | int | ssl,
|  | struct us_socket_context_t * | context,
|  | struct us_socket_t *(*)(struct us_socket_t *s) | on_timeout
| ) |  |

## ◆ us_socket_context_on_writable()

void us_socket_context_on_writable | ( | int | ssl,
|  | struct us_socket_context_t * | context,
|  | struct us_socket_t *(*)(struct us_socket_t *s) | on_writable
| ) |  |

Definition at line 448 of file context.c.

References us_socket_t::context, us_socket_context_t::on_writable, and us_internal_ssl_socket_context_on_writable().

Referenced by main().

Here is the call graph for this function:
Here is the caller graph for this function:

## ◆ us_socket_context_remove_server_name()

void us_socket_context_remove_server_name | ( | int | ssl,
|  | struct us_socket_context_t * | context,
|  | const char * | hostname_pattern
| ) |  |

Definition at line 167 of file context.c.

References us_internal_ssl_socket_context_remove_server_name().

Here is the call graph for this function:

## ◆ us_socket_context_timestamp()

unsigned short us_socket_context_timestamp | ( | int | ssl,
|  | struct us_socket_context_t * | context
| ) |  |

Definition at line 29 of file context.c.

References us_socket_context_t::timestamp.

## ◆ us_socket_ext()

void * us_socket_ext | ( | int | ssl,
|  | struct us_socket_t * | s
| ) |  |

Definition at line 167 of file socket.c.

References us_internal_ssl_socket_ext().

Referenced by on_echo_socket_close(), on_echo_socket_data(), on_echo_socket_open(), on_echo_socket_writable(), on_http_socket_data(), on_http_socket_open(), and on_http_socket_writable().

Here is the call graph for this function:
Here is the caller graph for this function:

## ◆ us_socket_flush()

void us_socket_flush | ( | int | ssl,
|  | struct us_socket_t * | s
| ) |  |

Definition at line 70 of file socket.c.

References bsd_socket_flush(), us_poll_fd(), and us_socket_is_shut_down().

Here is the call graph for this function:

## ◆ us_socket_get_native_handle()

void * us_socket_get_native_handle | ( | int | ssl,
|  | struct us_socket_t * | s
| ) |  |

Definition at line 137 of file socket.c.

References us_internal_ssl_socket_get_native_handle(), and us_poll_fd().

Here is the call graph for this function:

## ◆ us_socket_is_closed()

int us_socket_is_closed | ( | int | ssl,
|  | struct us_socket_t * | s
| ) |  |

Definition at line 76 of file socket.c.

References us_socket_t::context, and us_socket_t::prev.

Referenced by us_internal_dispatch_ready_poll(), us_listen_socket_close(), us_socket_close(), us_socket_close_connecting(), us_socket_context_adopt_socket(), us_socket_shutdown(), and us_socket_write().

Here is the caller graph for this function:

## ◆ us_socket_is_established()

int us_socket_is_established | ( | int | ssl,
|  | struct us_socket_t * | s
| ) |  |

Definition at line 80 of file socket.c.

References POLL_TYPE_SEMI_SOCKET, and us_internal_poll_type().

Here is the call graph for this function:

## ◆ us_socket_is_shut_down()

int us_socket_is_shut_down | ( | int | ssl,
|  | struct us_socket_t * | s
| ) |  |

Definition at line 177 of file socket.c.

References us_socket_t::p, POLL_TYPE_SOCKET_SHUT_DOWN, us_internal_poll_type(), and us_internal_ssl_socket_is_shut_down().

Referenced by us_internal_dispatch_ready_poll(), us_socket_flush(), us_socket_shutdown(), and us_socket_write().

Here is the call graph for this function:
Here is the caller graph for this function:

## ◆ us_socket_local_port()

int us_socket_local_port | ( | int | ssl,
|  | struct us_socket_t * | s
| ) |  |

Definition at line 26 of file socket.c.

References bsd_addr_get_port(), bsd_local_addr(), us_socket_t::p, and us_poll_fd().

Here is the call graph for this function:

## ◆ us_socket_long_timeout()

void us_socket_long_timeout | ( | int | ssl,
|  | struct us_socket_t * | s,
|  | unsigned int | minutes
| ) |  |

Definition at line 62 of file socket.c.

References us_socket_t::context, us_socket_t::long_timeout, and us_socket_context_t::long_timestamp.

## ◆ us_socket_remote_address()

void us_socket_remote_address | ( | int | ssl,
|  | struct us_socket_t * | s,
|  | char * | buf,
|  | int * | length
| ) |  |

Definition at line 40 of file socket.c.

References bsd_addr_get_ip(), bsd_addr_get_ip_length(), bsd_remote_addr(), us_socket_t::p, and us_poll_fd().

Here is the call graph for this function:

## ◆ us_socket_server_name_userdata()

void * us_socket_server_name_userdata | ( | int | ssl,
|  | struct us_socket_t * | s
| ) |  |

Definition at line 148 of file context.c.

References us_internal_ssl_socket_get_sni_userdata().

Here is the call graph for this function:

## ◆ us_socket_shutdown()

void us_socket_shutdown | ( | int | ssl,
|  | struct us_socket_t * | s
| ) |  |

Definition at line 187 of file socket.c.

References bsd_shutdown_socket(), us_socket_t::context, LIBUS_SOCKET_READABLE, us_socket_context_t::loop, us_socket_t::p, POLL_TYPE_SOCKET_SHUT_DOWN, us_internal_poll_set_type(), us_internal_ssl_socket_shutdown(), us_poll_change(), us_poll_events(), us_poll_fd(), us_socket_is_closed(), and us_socket_is_shut_down().

Referenced by on_echo_socket_end(), and on_http_socket_end().

Here is the call graph for this function:
Here is the caller graph for this function:

## ◆ us_socket_shutdown_read()

void us_socket_shutdown_read | ( | int | ssl,
|  | struct us_socket_t * | s
| ) |  |

Definition at line 35 of file socket.c.

References bsd_shutdown_socket_read(), and us_poll_fd().

Here is the call graph for this function:

## ◆ us_socket_timeout()

void us_socket_timeout | ( | int | ssl,
|  | struct us_socket_t * | s,
|  | unsigned int | seconds
| ) |  |

Definition at line 54 of file socket.c.

References us_socket_t::context, us_socket_t::timeout, and us_socket_context_t::timestamp.

Referenced by on_echo_socket_data(), on_echo_socket_open(), on_echo_socket_writable(), on_http_socket_data(), on_http_socket_open(), and us_internal_dispatch_ready_poll().

Here is the caller graph for this function:

## ◆ us_socket_write()

int us_socket_write | ( | int | ssl,
|  | struct us_socket_t * | s,
|  | const char * | data,
|  | int | length,
|  | int | msg_more
| ) |  |

Definition at line 147 of file socket.c.

References bsd_send(), us_socket_t::context, us_loop_t::data, us_internal_loop_data_t::last_write_failed, LIBUS_SOCKET_READABLE, LIBUS_SOCKET_WRITABLE, us_socket_context_t::loop, us_socket_t::p, us_internal_ssl_socket_write(), us_poll_change(), us_poll_fd(), us_socket_is_closed(), and us_socket_is_shut_down().

Referenced by on_echo_socket_data(), on_echo_socket_writable(), on_http_socket_data(), and on_http_socket_writable().

Here is the call graph for this function:
Here is the caller graph for this function:

## ◆ us_timer_close()

void us_timer_close | ( | struct us_timer_t * | timer | ) |

Referenced by us_internal_loop_data_free().

Here is the caller graph for this function:

## ◆ us_timer_ext()

void * us_timer_ext | ( | struct us_timer_t * | timer | ) |

## ◆ us_timer_loop()

struct us_loop_t * us_timer_loop | ( | struct us_timer_t * | t | ) |

## ◆ us_timer_set()

void us_timer_set | ( | struct us_timer_t * | timer,
|  | void(*)(struct us_timer_t *t) | cb,
|  | int | ms,
|  | int | repeat_ms
| ) |  |

Referenced by us_loop_integrate().

Here is the caller graph for this function:

## ◆ us_udp_buffer_set_packet_payload()

void us_udp_buffer_set_packet_payload | ( | struct us_udp_packet_buffer_t * | send_buf,
|  | int | index,
|  | int | offset,
|  | void * | payload,
|  | int | length,
|  | void * | peer_addr
| ) |  |

Definition at line 59 of file udp.c.

References bsd_udp_buffer_set_packet_payload().

Here is the call graph for this function:

## ◆ us_udp_packet_buffer_ecn()

int us_udp_packet_buffer_ecn | ( | struct us_udp_packet_buffer_t * | buf,
|  | int | index
| ) |  |

Definition at line 25 of file udp.c.

References bsd_udp_packet_buffer_ecn().

Here is the call graph for this function:

## ◆ us_udp_packet_buffer_local_ip()

int us_udp_packet_buffer_local_ip | ( | struct us_udp_packet_buffer_t * | buf,
|  | int | index,
|  | char * | ip
| ) |  |

Definition at line 29 of file udp.c.

References bsd_udp_packet_buffer_local_ip().

Here is the call graph for this function:

## ◆ us_udp_packet_buffer_payload()

char * us_udp_packet_buffer_payload | ( | struct us_udp_packet_buffer_t * | buf,
|  | int | index
| ) |  |

Definition at line 37 of file udp.c.

References bsd_udp_packet_buffer_payload().

Here is the call graph for this function:

## ◆ us_udp_packet_buffer_payload_length()

int us_udp_packet_buffer_payload_length | ( | struct us_udp_packet_buffer_t * | buf,
|  | int | index
| ) |  |

Definition at line 41 of file udp.c.

References bsd_udp_packet_buffer_payload_length().

Here is the call graph for this function:

## ◆ us_udp_packet_buffer_peer()

char * us_udp_packet_buffer_peer | ( | struct us_udp_packet_buffer_t * | buf,
|  | int | index
| ) |  |

Definition at line 33 of file udp.c.

References bsd_udp_packet_buffer_peer().

Here is the call graph for this function:

## ◆ us_udp_socket_bind()

int us_udp_socket_bind | ( | struct us_udp_socket_t * | s,
|  | const char * | hostname,
|  | unsigned int | port
| ) |  |

## ◆ us_udp_socket_bound_port()

int us_udp_socket_bound_port | ( | struct us_udp_socket_t * | s | ) |

Definition at line 79 of file udp.c.

## ◆ us_udp_socket_receive()

int us_udp_socket_receive | ( | struct us_udp_socket_t * | s,
|  | struct us_udp_packet_buffer_t * | buf
| ) |  |

Definition at line 54 of file udp.c.

References bsd_recvmmsg(), LIBUS_UDP_MAX_NUM, and us_poll_fd().

Referenced by internal_on_udp_read().

Here is the call graph for this function:
Here is the caller graph for this function:

## ◆ us_udp_socket_send()

int us_udp_socket_send | ( | struct us_udp_socket_t * | s,
|  | struct us_udp_packet_buffer_t * | buf,
|  | int | num
| ) |  |

Definition at line 46 of file udp.c.

References bsd_sendmmsg(), and us_poll_fd().

Here is the call graph for this function:

## ◆ us_udp_socket_user()

void * us_udp_socket_user | ( | struct us_udp_socket_t * | s | ) |

Definition at line 98 of file udp.c.

References us_internal_udp_t::user.

## ◆ us_wakeup_loop()

void us_wakeup_loop | ( | struct us_loop_t * | loop | ) |

Definition at line 53 of file loop.c.

References us_loop_t::data, us_internal_async_wakeup(), and us_internal_loop_data_t::wakeup_async.

Here is the call graph for this function: