Event loop (headers)
More...
#include <stdint.h>
#include <glib.h>
#include "network.h"
Go to the source code of this file.
Event loop (headers)
- Author
- Lorenzo Miniero loren.nosp@m.zo@m.nosp@m.eetec.nosp@m.ho.c.nosp@m.om
- Copyright
- MIT License
Implementation of an event loop to be used in the imquic library internals, mostly for networking and the dispatching of some events.
◆ imquic_connection_event
typedef struct imquic_connection_event imquic_connection_event |
Events meant for connections.
◆ imquic_source
typedef struct imquic_source imquic_source |
◆ imquic_loop_add_timer()
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.
- Parameters
-
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 |
- Returns
- A pointer to the imquic_source, if successful, or NULL otherwise
◆ imquic_loop_deinit()
void imquic_loop_deinit |
( |
void | | ) |
|
Uninitialize the event loop.
◆ imquic_loop_init()
int imquic_loop_init |
( |
void | | ) |
|
Initialize the event loop.
◆ imquic_loop_poll_connection()
Monitor events associated to a connection in the core as part of the loop.
- Parameters
-
- Returns
- A pointer to the imquic_source, if successful, or NULL otherwise
◆ imquic_loop_poll_endpoint()
Monitor an endpoint socket as part of the loop.
- Parameters
-
- Returns
- A pointer to the imquic_source, if successful, or NULL otherwise
◆ imquic_loop_wakeup()
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.