![]() |
Nilorea Library
C utilities for networking, threading, graphics
|
#include "nilorea/n_str.h"#include "nilorea/n_log.h"#include "nilorea/n_network.h"#include <getopt.h>#include <string.h>
Include dependency graph for ex_network_sse.c:Go to the source code of this file.
Macros | |
| #define | MAX_EVENTS 3 |
| maximum number of events to receive before stopping | |
Functions | |
| int | main (int argc, char *argv[]) |
| static void | on_sse_event (N_SSE_EVENT *event, N_SSE_CONN *conn, void *user_data) |
| SSE event callback. | |
| void | usage (void) |
Variables | |
| static int | event_count = 0 |
| counter for received events | |
| static N_SSE_CONN * | g_conn = NULL |
| pointer to connection for callback to stop | |
| #define MAX_EVENTS 3 |
maximum number of events to receive before stopping
Definition at line 35 of file ex_network_sse.c.
| int main | ( | int | argc, |
| char * | argv[] | ||
| ) |
Definition at line 69 of file ex_network_sse.c.
References event_count, g_conn, getoptret, LOG_DEBUG, LOG_ERR, LOG_INFO, log_level, LOG_NOTICE, LOG_NULL, n_log, n_sse_conn_free(), n_sse_connect(), on_sse_event(), set_log_level(), and usage().
Here is the call graph for this function:
|
static |
SSE event callback.
| event | the received SSE event |
| conn | the SSE connection |
| user_data | unused |
Definition at line 53 of file ex_network_sse.c.
References N_SSE_EVENT::data, N_STR::data, N_SSE_EVENT::event, event_count, g_conn, N_SSE_EVENT::id, MAX_EVENTS, and n_sse_stop().
Referenced by main().
Here is the call graph for this function:
Here is the caller graph for this function:| void usage | ( | void | ) |
Definition at line 42 of file ex_network_sse.c.
|
static |
counter for received events
Definition at line 38 of file ex_network_sse.c.
Referenced by main(), and on_sse_event().
|
static |
pointer to connection for callback to stop
Definition at line 40 of file ex_network_sse.c.
Referenced by main(), and on_sse_event().