44#ifndef NILOREA_N_REACTOR_H
45#define NILOREA_N_REACTOR_H
57#ifndef N_REACTOR_AVAILABLE
58#if defined(__linux__) || defined(__ANDROID__)
59#define N_REACTOR_AVAILABLE 1
61#define N_REACTOR_AVAILABLE 0
250 size_t send_list_limit,
251 size_t recv_list_limit,
NETWORK * netw
Network for server mode, accepting incomming.
Common headers and low-level functions & define.
long long fds_registered
lifetime register call count
long long writes_partial
EAGAIN on send -> re-armed EPOLLOUT.
long long reads_partial
EAGAIN on recv -> kept accumulator.
long long events_processed
total epoll events dispatched
void * n_reactor_run_thread_entry(void *arg)
pthread_create-compatible entry point that calls n_reactor_run on the reactor passed via arg.
long long wake_signals
eventfd wake events processed
void n_reactor_run(n_reactor *reactor)
Run the epoll loop on the calling thread.
long long wake_walk_visits
long long wake_walk_drains
void n_reactor_get_stats(const n_reactor *reactor, n_reactor_stats *out)
Read current stats counters into *out.
struct n_reactor n_reactor
Opaque reactor handle.
n_reactor * n_reactor_new(int max_fds_hint)
Create a new reactor.
long long fds_unregistered
lifetime unregister call count
NETWORK * netw_accept_into_reactor(NETWORK *listener, size_t send_list_limit, size_t recv_list_limit, int blocking, n_reactor *reactor, int *retval)
Accept a connection on listener and register it with reactor instead of starting per-connection threa...
void n_reactor_unregister(n_reactor *reactor, NETWORK *netw)
Unregister a NETWORK from the reactor.
int n_reactor_register(n_reactor *reactor, NETWORK *netw)
Register a NETWORK with the reactor.
void n_reactor_notify_send(NETWORK *netw)
Producer-side wake-up after a netw_add_msg.
void n_reactor_close_netw_sync(NETWORK *netw)
Synchronously close a reactor-registered NETWORK from the game thread.
void n_reactor_stop(n_reactor *reactor)
Signal the run loop to exit at the next iteration.
void n_reactor_destroy(n_reactor **reactor)
Tear down a reactor.
Counters for the dashboard / profile_server.sh.