Nilorea Library
C utilities for networking, threading, graphics
ex_network.c File Reference
#include <stdio.h>
#include <errno.h>
#include "ex_network.h"
+ Include dependency graph for ex_network.c:

Go to the source code of this file.

Macros

#define CLIENT   1
 
#define SERVER   0
 

Functions

int main (int argc, char **argv)
 
void process_args (int argc, char **argv, char **address, char **server, char **port, int *nb, int *ip_version)
 
void usage (void)
 

Variables

int ip_version = 0
 
int mode = -1
 Network for managing conenctions. More...
 
int NB_ATTEMPTS = 3
 
NETWORKnetw = NULL
 Network for server mode, accepting incomming. More...
 
static pthread_t netw_thr
 
NETWORKserver = NULL
 

Macro Definition Documentation

◆ CLIENT

#define CLIENT   1
Examples
ex_network.c.

Definition at line 13 of file ex_network.c.

◆ SERVER

#define SERVER   0
Examples
ex_network.c.

Definition at line 12 of file ex_network.c.

Function Documentation

◆ main()

◆ process_args()

void process_args ( int  argc,
char **  argv,
char **  address,
char **  server,
char **  port,
int *  nb,
int *  ip_version 
)
Examples
ex_network.c.

Definition at line 35 of file ex_network.c.

References getoptret, LOG_DEBUG, LOG_ERR, LOG_INFO, log_level, LOG_NOTICE, LOG_NULL, n_log, NETWORK_IPV4, NETWORK_IPV6, set_log_level(), and usage().

Referenced by main().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ usage()

void usage ( void  )
Examples
ex_network.c.

Definition at line 24 of file ex_network.c.

Referenced by process_args().

+ Here is the caller graph for this function:

Variable Documentation

◆ ip_version

int ip_version = 0
Examples
ex_network.c.

Definition at line 20 of file ex_network.c.

Referenced by main().

◆ mode

◆ NB_ATTEMPTS

int NB_ATTEMPTS = 3
Examples
ex_network.c.

Definition at line 15 of file ex_network.c.

Referenced by main().

◆ netw

NETWORK * netw = NULL

◆ netw_thr

pthread_t netw_thr
static
Examples
ex_network.c.

Definition at line 22 of file ex_network.c.

Referenced by main().

◆ server

NETWORK* server = NULL
Examples
ex_network.c.

Definition at line 17 of file ex_network.c.

Referenced by main().