|
trafilo 0.1.0
Streaming event-handler framework in C
|
#include "headers/socket.h"Functions | |
| static void * | listener_loop (void *arg) |
| Looping function for socket thread. | |
| listener_t * | listener_create (int port, bounded_queue_t *bounded_q, size_t max_line) |
| Allocate a listener bound to the given UDP port. | |
| int | listener_start (listener_t *listener) |
| Spawn the receive thread. | |
| void | listener_stop (listener_t *listener) |
| Signal the receive thread to exit and join it. Does NOT shut down the queue — caller decides when to call bq_shutdown. | |
| void | listener_destroy (listener_t *listener) |
| Free the listener and close its socket. | |
| listener_t * listener_create | ( | int | port, |
| bounded_queue_t * | bounded_q, | ||
| size_t | max_line ) |
Allocate a listener bound to the given UDP port.
| port | UDP port to bind on. |
| bounded_q | Queue raw lines are pushed onto. Listener does NOT take ownership — caller manages lifetime. |
| max_line | The max buffer length per line. |
| void listener_destroy | ( | listener_t * | listener | ) |
Free the listener and close its socket.
| listener | Listener to destroy. |
|
static |
Looping function for socket thread.
| arg | The listener_t of the connection |
| int listener_start | ( | listener_t * | listener | ) |
Spawn the receive thread.
| listener | Listener to start. |
| void listener_stop | ( | listener_t * | listener | ) |
Signal the receive thread to exit and join it. Does NOT shut down the queue — caller decides when to call bq_shutdown.
| listener | Listener to stop. |