![]() |
Nilorea Library
C utilities for networking, threading, graphics
|
Accept pool for parallel connection acceptance (nginx-style) More...
Include dependency graph for n_network_accept_pool.c:Go to the source code of this file.
Functions | |
| NETW_ACCEPT_POOL * | netw_accept_pool_create (NETWORK *server, size_t nb_threads, int accept_timeout, netw_accept_callback_t callback, void *user_data) |
| Create a new accept pool. | |
| int | netw_accept_pool_destroy (NETW_ACCEPT_POOL **pool) |
| Destroy an accept pool. | |
| int | netw_accept_pool_get_stats (NETW_ACCEPT_POOL *pool, NETW_ACCEPT_POOL_STATS *stats) |
| Get a snapshot of pool statistics. | |
| int | netw_accept_pool_start (NETW_ACCEPT_POOL *pool) |
| Start the accept pool (launches accept threads) | |
| int | netw_accept_pool_stop (NETW_ACCEPT_POOL *pool) |
| Request the accept pool to stop. | |
| static void * | netw_accept_pool_thread_func (void *arg) |
| Thread function for accept pool workers. | |
| int | netw_accept_pool_wait (NETW_ACCEPT_POOL *pool, int timeout_sec) |
| Wait for all accept threads to finish after a stop request. | |
Accept pool for parallel connection acceptance (nginx-style)
Definition in file n_network_accept_pool.c.
|
static |
Thread function for accept pool workers.
Each thread loops calling accept on the shared listening socket and invokes the user callback for each accepted connection.
| arg | pointer to the NETW_ACCEPT_POOL |
Definition at line 39 of file n_network_accept_pool.c.
References __n_assert, LOG_ERR, n_log, netw_accept_from_ex(), netw_accept_pool_atomic_read_state, NETW_ACCEPT_POOL_RUNNING, netw_close(), pool, and u_sleep().
Referenced by netw_accept_pool_start().
Here is the call graph for this function:
Here is the caller graph for this function: