Nilorea Library
C utilities for networking, threading, graphics
Loading...
Searching...
No Matches
ex_network_connect_abort.c File Reference
#include "nilorea/n_log.h"
#include "nilorea/n_network.h"
#include "nilorea/n_time.h"
+ Include dependency graph for ex_network_connect_abort.c:

Go to the source code of this file.

Macros

#define ABORT_MAX_MS   3000
 An aborted connect must return in well under the connect budget.
 
#define BLACKHOLE_HOST   "192.0.2.1"
 Blackhole target: RFC 5737 documentation range, never has a listener.
 
#define BLACKHOLE_PORT   "80"
 Blackhole port (any).
 
#define LONG_CONNECT_TIMEOUT_MS   20000
 Long connect budget so an un-aborted attempt would clearly out-last an aborted one.
 

Functions

static int abort_now (void *ctx)
 Connect-abort callback that always asks to abort, counting its polls.
 
int main (void)
 

Variables

static int g_polls = 0
 Count of times the abort callback was polled (proves it ran).
 

Macro Definition Documentation

◆ ABORT_MAX_MS

#define ABORT_MAX_MS   3000

An aborted connect must return in well under the connect budget.

Examples
ex_network_connect_abort.c.

Definition at line 47 of file ex_network_connect_abort.c.

◆ BLACKHOLE_HOST

#define BLACKHOLE_HOST   "192.0.2.1"

Blackhole target: RFC 5737 documentation range, never has a listener.

Examples
ex_network_connect_abort.c.

Definition at line 41 of file ex_network_connect_abort.c.

◆ BLACKHOLE_PORT

#define BLACKHOLE_PORT   "80"

Blackhole port (any).

Examples
ex_network_connect_abort.c.

Definition at line 43 of file ex_network_connect_abort.c.

◆ LONG_CONNECT_TIMEOUT_MS

#define LONG_CONNECT_TIMEOUT_MS   20000

Long connect budget so an un-aborted attempt would clearly out-last an aborted one.

Examples
ex_network_connect_abort.c.

Definition at line 45 of file ex_network_connect_abort.c.

Function Documentation

◆ abort_now()

static int abort_now ( void *  ctx)
static

Connect-abort callback that always asks to abort, counting its polls.

Examples
ex_network_connect_abort.c.

Definition at line 53 of file ex_network_connect_abort.c.

References g_polls.

Referenced by main().

+ Here is the caller graph for this function:

◆ main()

Variable Documentation

◆ g_polls

int g_polls = 0
static

Count of times the abort callback was polled (proves it ran).

Examples
ex_network_connect_abort.c.

Definition at line 50 of file ex_network_connect_abort.c.

Referenced by abort_now(), and main().