Event loop. More...
#include <stdlib.h>
#include <stdint.h>
#include <stdio.h>
#include <string.h>
#include <inttypes.h>
#include <unistd.h>
#include <arpa/inet.h>
#include "internal/loop.h"
#include "internal/network.h"
#include "internal/quic.h"
#include "imquic/debug.h"
Data Structures | |
struct | imquic_network_source |
struct | imquic_connection_source |
Typedefs | |
typedef struct imquic_network_source | imquic_network_source |
typedef struct imquic_connection_source | imquic_connection_source |
Functions | |
int | imquic_loop_init (void) |
Initialize the event loop. | |
void | imquic_loop_wakeup (void) |
Helper method to wake the event loop, in case it's waiting for something and we need to refresh the list of events to monitor. | |
void | imquic_loop_deinit (void) |
Uninitialize the event loop. | |
imquic_source * | imquic_loop_poll_endpoint (void *e) |
Monitor an endpoint socket as part of the loop. | |
imquic_source * | imquic_loop_poll_connection (void *c) |
Monitor events associated to a connection in the core as part of the loop. | |
imquic_source * | imquic_loop_add_timer (guint ms, GSourceFunc func, gpointer data) |
Helper method to add a timed source to the loop, to fire the provided callback every tot milliseconds and passing the provided data. | |
Event loop.
Implementation of an event loop to be used in the imquic library internals, mostly for networking and the dispatching of some events.
typedef struct imquic_connection_source imquic_connection_source |
typedef struct imquic_network_source imquic_network_source |
imquic_source * imquic_loop_add_timer | ( | guint | ms, |
GSourceFunc | func, | ||
gpointer | data ) |
Helper method to add a timed source to the loop, to fire the provided callback every tot milliseconds and passing the provided data.
ms | Call the callback every tot milliseconds |
func | Callback to invoke when the regular timer fires |
data | Optional user data to pass to the callback function, for correlation purposes |
void imquic_loop_deinit | ( | void | ) |
Uninitialize the event loop.
int imquic_loop_init | ( | void | ) |
Initialize the event loop.
imquic_source * imquic_loop_poll_connection | ( | void * | c | ) |
Monitor events associated to a connection in the core as part of the loop.
c | Opaque pointer to a imquic_connection instance |
imquic_source * imquic_loop_poll_endpoint | ( | void * | e | ) |
Monitor an endpoint socket as part of the loop.
e | Opaque pointer to a imquic_network_endpoint instance |
void imquic_loop_wakeup | ( | void | ) |
Helper method to wake the event loop, in case it's waiting for something and we need to refresh the list of events to monitor.