10#include <netinet/in.h>
listener_t * listener_create(int port, bounded_queue_t *bounded_q, size_t max_line)
Allocate a listener bound to the given UDP port.
Definition socket.c:50
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 ...
Definition socket.c:107
void listener_destroy(listener_t *listener)
Free the listener and close its socket.
Definition socket.c:115
int listener_start(listener_t *listener)
Spawn the receive thread.
Definition socket.c:93
A Circular ring queue, fixed size, to create a pool of events to be parsed.
Definition bounded_queue.h:12
UDP listener handle.
Definition socket.h:19
bounded_queue_t * bounded_q
Definition socket.h:21
pthread_t thread
Definition socket.h:23
volatile int done
Definition socket.h:25
size_t max_line
Definition socket.h:22
int started
Definition socket.h:24
int sockfd
Definition socket.h:20