Nilorea Library
C utilities for networking, threading, graphics
Loading...
Searching...
No Matches
n_network.h
Go to the documentation of this file.
1
8#ifndef N_NETWORK
9#define N_NETWORK
10
11#ifdef __cplusplus
12extern "C" {
13#endif
14
20#include "n_common.h"
21#include "n_str.h"
22#include "n_list.h"
23#include "n_hash.h"
24
26#define NETWORK_IPALL 0
28#define NETWORK_IPV4 1
30#define NETWORK_IPV6 2
32#define NETWORK_DEPLETE_SOCKET_TIMEOUT 512
34#define NETWORK_DEPLETE_QUEUES_TIMEOUT 1024
36#define NETWORK_CONSECUTIVE_SEND_WAIT 2048
38#define NETWORK_WAIT_CLOSE_TIMEOUT 4096
40#define HEAD_SIZE 10
42#define HEAD_CODE 3
44#define NETW_SOCKET_ERROR -1
46#define NETW_SOCKET_DISCONNECTED -2
48#define NETW_MAX_RETRIES 128
49
50#ifndef SOCKET
52#ifdef __windows__
53#ifndef ARCH32BITS
55typedef long long unsigned int SOCKET;
57#define SOCKET_SIZE_FORMAT "%zu"
58#endif
59#else
61typedef int SOCKET;
63#define SOCKET_SIZE_FORMAT "%d"
64#endif
65#endif
66
67#if defined(__linux__) || defined(__sun) || defined(_AIX)
68#include <sys/types.h>
69#include <fcntl.h>
70#include <stdio.h>
71#include <errno.h>
72#include <unistd.h>
73#include <malloc.h>
74#include <string.h>
75#include <netinet/in.h>
76#include <netinet/tcp.h>
77#include <arpa/inet.h>
78#include <netdb.h>
79#include <sys/ioctl.h>
80#include <sys/socket.h>
81#include <semaphore.h>
82
84#define SOCKET_SIZE_FORMAT "%d"
85
86#ifdef __linux__
87#include <linux/sockios.h>
88#include <signal.h>
89#endif
90
91#define netw_unload()
92
94#define closesocket close
96#define NETFLAGS MSG_NOSIGNAL /* for program to not quit under linux when a connection is crashing 2 times */
98#define INVALID_SOCKET -1
99
100#include "n_time.h"
101
102#elif defined __windows__
103
104#define SHUT_WR SD_SEND
105#define SHUT_RD SD_RECEIVE
106#define SHUT_RDWR SD_BOTH
107
108#ifndef ECONNRESET
109#define ECONNRESET 104
110#endif
111
112#if (_WIN32_WINNT < 0x0501)
113#undef _WIN32_WINNT
114#define _WIN32_WINNT 0x0501
115#endif
116
117#include <errno.h>
118#include <unistd.h>
119#include <malloc.h>
120#include <string.h>
121#include <winsock2.h>
122#include <windows.h>
123#include <ws2tcpip.h>
124#include "n_time.h"
125
126#ifndef MSG_EOR
127#define MSG_EOR 0
128#endif
129
130#ifndef MSG_NOSIGNAL
131#define MSG_NOSIGNAL 0
132#endif
133
134#ifndef MSG_WAITALL
135#define MSG_WAITALL 0
136#endif
137
138#ifndef EAI_SYSTEM
139#define EAI_SYSTEM 0
140#endif
141
142#ifndef AI_PASSIVE
143#define AI_PASSIVE 0x00000001
144#endif
145#ifndef AI_CANONNAME
146#define AI_CANONNAME 0x00000002
147#endif
148#ifndef AI_NUMERICHOST
149#define AI_NUMERICHOST 0x00000004
150#endif
151#ifndef AI_NUMERICSERV
152#define AI_NUMERICSERV 0x00000008
153#endif
154#ifndef AI_ALL
155#define AI_ALL 0x00000100
156#endif
157#ifndef AI_ADDRCONFIG
158#define AI_ADDRCONFIG 0x00000400
159#endif
160#ifndef AI_V4MAPPED
161#define AI_V4MAPPED 0x00000800
162#endif
163#ifndef AI_NON_AUTHORITATIVE
164#define AI_NON_AUTHORITATIVE 0x00004000
165#endif
166#ifndef AI_SECURE
167#define AI_SECURE 0x00008000
168#endif
169#ifndef AI_RETURN_PREFERRED_NAMES
170#define AI_RETURN_PREFERRED_NAMES 0x00010000
171#endif
172
173#include <pthread.h>
174#include <semaphore.h>
175
177#define NETFLAGS 0 /* no flags needed for microsoft */
178
180#define netw_unload() netw_init_wsa(0, 2, 2)
181
182#endif
183
184#ifdef HAVE_OPENSSL
185#define _OPEN_SYS_SOCK_IPV6 1
186#include <openssl/err.h>
187#include <openssl/ssl.h>
188#include <openssl/crypto.h>
189#endif
190
192#define N_ENUM_netw_code_type(_) \
193 _(NETW_CLIENT, 2) \
194 _(NETW_SERVER, 4) \
195 _(NETW_RESTART_TIMER, 8) \
196 _(NETW_EMPTY_SENDBUF, 16) \
197 _(NETW_EMPTY_RECVBUF, 32) \
198 _(NETW_RUN, 64) \
199 _(NETW_EXIT_ASKED, 128) \
200 _(NETW_EXITED, 256) \
201 _(NETW_ERROR, 512) \
202 _(NETW_ENCRYPT_NONE, 1024) \
203 _(NETW_ENCRYPT_OPENSSL, 2048) \
204 _(NETW_THR_ENGINE_STARTED, 4096) \
205 _(NETW_THR_ENGINE_STOPPED, 8192) \
206 _(NETW_DESTROY_RECVBUF, 16384) \
207 _(NETW_DESTROY_SENDBUF, 32768)
208
211
213typedef ssize_t (*netw_func)(void*, char*, uint32_t);
214
216typedef struct N_SOCKET {
218 char* port;
222 char* ip;
223
225 unsigned long int is_blocking;
226
228 struct addrinfo hints;
230 struct addrinfo* rhost;
232 struct sockaddr_storage raddr;
233} N_SOCKET;
234
327
329typedef struct NETWORK_POOL {
332
334 pthread_rwlock_t rwlock;
335
337
339typedef struct NETWORK_HTTP_INFO {
340 // Store content type
341 char content_type[256];
342 // Store content length
343 size_t content_length;
344 // Pointer to the body data
345 char* body;
346 // Type of request
347 char* type;
349
350/* host to network size_t */
351size_t htonst(size_t value);
352/* network to host size_t */
353size_t ntohst(size_t value);
354#ifdef HAVE_OPENSSL
355/* set SSL */
356int netw_set_crypto(NETWORK* netw, char* key, char* certificate);
357/* init ssl helper */
358int netw_init_openssl(void);
359/* unload ssl helper */
360int netw_unload_openssl(void);
361/* connect ssl helper */
362int netw_ssl_connect(NETWORK** netw, char* host, char* port, int ip_version, char* ssl_key_file, char* ssl_cert_file);
363/* SSL Writting to a socket */
364ssize_t send_ssl_data(void* netw, char* buf, uint32_t n);
365/* SSL Reading from a socket */
366ssize_t recv_ssl_data(void* netw, char* buf, uint32_t n);
367#endif
368/* Used by Init & Close network */
369int netw_init_wsa(int mode, int v1, int v2);
370/* Set flags on network */
371int netw_set(NETWORK* netw, int flag);
372/* Get flags from network */
373int netw_get_state(NETWORK* netw, uint32_t* state, int* thr_engine_status);
374/* Set common socket options (disable naggle, send/recv buf, reuse addr) */
375int netw_setsockopt(NETWORK* netw, int optname, int value);
376/* set blocking mode */
377int netw_set_blocking(NETWORK* netw, unsigned long int is_blocking);
378/* Connecting, extended */
379int netw_connect_ex(NETWORK** netw, char* host, char* port, size_t send_list_limit, size_t recv_list_limit, int ip_version, char* ssl_key_file, char* ssl_cert_file);
380/* Connecting */
381int netw_connect(NETWORK** netw, char* host, char* port, int ip_version);
382/* wait for send buffer to be empty */
383int deplete_send_buffer(int fd, int timeout);
384/* Closing */
385int netw_close(NETWORK** netw);
386/* Closing for peer */
387int netw_wait_close(NETWORK** netw);
388/* Closing for peer timeouted*/
389int netw_wait_close_timed(NETWORK** netw, size_t timeout);
390/* Stop a NETWORK connection sending and receing thread */
392/* Listening network */
393int netw_make_listening(NETWORK** netw, char* addr, char* port, int nbpending, int ip_version);
394/* Accepting routine extended */
395NETWORK* netw_accept_from_ex(NETWORK* from, size_t send_list_limit, size_t recv_list_limit, int blocking, int* retval);
396/* Accepting routine */
398/* Accepting routine */
399NETWORK* netw_accept_nonblock_from(NETWORK* from, int blocking);
400/* Add a message to send in aimed NETWORK */
401int netw_add_msg(NETWORK* netw, N_STR* msg);
402/* Add a char message to send in the aimed NETWORK */
403int netw_add_msg_ex(NETWORK* netw, char* str, unsigned int length);
404/* Get a message from aimed NETWORK. Instant return to NULL if no MSG */
406/* Wait a message from aimed NETWORK. Recheck each 'refresh' usec until 'timeout' usec */
407N_STR* netw_wait_msg(NETWORK* netw, unsigned int refresh, size_t timeout);
408/* Create the sending and receiving thread of a NETWORK */
410/* Thread Sending management function */
411void* netw_send_func(void* NET);
412/* Thread Receiving management function */
413void* netw_recv_func(void* NET);
414/* Writting to a socket */
415ssize_t send_data(void* netw, char* buf, uint32_t n);
416/* Reading from a socket */
417ssize_t recv_data(void* netw, char* buf, uint32_t n);
418/* sending to php */
419ssize_t send_php(SOCKET s, int _code, char* buf, int n);
420/* receive from php */
421ssize_t recv_php(SOCKET s, int* _code, char** buf);
422/* get queue status */
423int netw_get_queue_status(NETWORK* netw, size_t* nb_to_send, size_t* nb_to_read);
424
425/* init pools */
426NETWORK_POOL* netw_new_pool(size_t nb_min_element);
427/* destroy pool */
428int netw_destroy_pool(NETWORK_POOL** netw_pool);
429/* close pool */
430void netw_pool_netw_close(void* netw_ptr);
431/* add network to pool */
432int netw_pool_add(NETWORK_POOL* netw_pool, NETWORK* netw);
433/* add network to pool */
434int netw_pool_remove(NETWORK_POOL* netw_pool, NETWORK* netw);
435/* add message to pool */
436int netw_pool_broadcast(NETWORK_POOL* netw_pool, NETWORK* from, N_STR* net_msg);
437/* get nb clients */
438size_t netw_pool_nbclients(NETWORK_POOL* netw_pool);
439
440/* set user id on a netw */
441int netw_set_user_id(NETWORK* netw, int id);
442
443/* homemade tcp ip protocol helpers */
444int netw_send_ping(NETWORK* netw, int type, int id_from, int id_to, int time);
445int netw_send_ident(NETWORK* netw, int type, int id, N_STR* name, N_STR* passwd);
446int netw_send_position(NETWORK* netw, int id, double X, double Y, double vx, double vy, double acc_x, double acc_y, int time_stamp);
447int netw_send_string_to(NETWORK* netw, int id_to, N_STR* name, N_STR* chan, N_STR* txt, int color);
448int netw_send_string_to_all(NETWORK* netw, N_STR* name, N_STR* chan, N_STR* txt, int color);
449int netw_send_quit(NETWORK* netw);
450
451/* http helpers */
452size_t netw_calculate_urlencoded_size(const char* str, size_t len);
453char* netw_extract_http_request_type(const char* request);
455int netw_info_destroy(NETWORK_HTTP_INFO http_request);
456char* netw_urlencode(const char* str, size_t len);
457int netw_get_url_from_http_request(const char* request, char* url, size_t size);
458char* netw_urldecode(const char* str);
459HASH_TABLE* netw_parse_post_data(const char* post_data);
460const char* netw_guess_http_content_type(const char* url);
461const char* netw_get_http_status_message(int status_code);
462int netw_get_http_date(char* buffer, size_t buffer_size);
463int netw_build_http_response(N_STR** http_response, int status_code, const char* server_name, const char* content_type, char* additional_headers, N_STR* body);
464
469#ifdef __cplusplus
470}
471#endif
472
473#endif /*#ifndef N_NETWORK*/
#define N_ENUM_DECLARE(MACRO_DEFINITION, enum_name)
Macro to declare a N_ENUM.
Definition n_enum.h:132
structure of a hash table
Definition n_hash.h:114
Structure of a generic LIST container.
Definition n_list.h:39
A box including a string and his lenght.
Definition n_str.h:39
struct addrinfo * rhost
getaddrinfo results
Definition n_network.h:230
int crypto_mode
tell if the socket have to be encrypted (flags NETW_CRYPTO_*)
Definition n_network.h:266
char * ip
ip of the connected socket
Definition n_network.h:222
N_SOCKET link
networking socket
Definition n_network.h:302
char * certificate
openssl certificate file
Definition n_network.h:296
int threaded_engine_status
Threaded network engine state for this network.
Definition n_network.h:242
pthread_t send_thr
sending thread
Definition n_network.h:310
int nb_pending
Nb pending connection,if listening.
Definition n_network.h:238
int so_reuseaddr
so reuseaddr state
Definition n_network.h:248
pthread_t recv_thr
receiving thread
Definition n_network.h:312
pthread_rwlock_t rwlock
thread safety
Definition n_network.h:334
struct sockaddr_storage raddr
connected remote addr
Definition n_network.h:232
pthread_mutex_t eventbolt
mutex for threaded access of state event
Definition n_network.h:319
const SSL_METHOD * method
SSL method container.
Definition n_network.h:290
int deplete_socket_timeout
deplete socket send buffer timeout ( 0 disabled, > 0 wait for timeout and check unset/unack datas)
Definition n_network.h:276
int deplete_queues_timeout
deplete network queues timeout ( 0 disabled, > 0 wait for timeout and check unset/unack datas)
Definition n_network.h:274
int nb_running_threads
nb running threads, if > 0 thread engine is still running
Definition n_network.h:272
pthread_mutex_t recvbolt
mutex for threaded access of recv buf
Definition n_network.h:317
pthread_mutex_t sendbolt
mutex for threaded access of send_buf
Definition n_network.h:315
int send_queue_consecutive_wait
send queue consecutive pool interval, used when there are still items to send, in usec
Definition n_network.h:246
int so_rcvtimeo
send timeout value
Definition n_network.h:262
int tcpnodelay
state of naggle algorythm, 0 untouched, 1 forcibly disabled
Definition n_network.h:254
SOCKET sock
a normal socket
Definition n_network.h:220
char * port
port of socket
Definition n_network.h:218
LIST * recv_buf
reveicing buffer (for incomming usage)
Definition n_network.h:307
int user_id
if part of a user property, id of the user
Definition n_network.h:270
sem_t send_blocker
block sending func
Definition n_network.h:321
SSL_CTX * ctx
SSL context holder.
Definition n_network.h:292
int so_sndbuf
size of the socket send buffer, 0 untouched, else size in bytes
Definition n_network.h:256
int so_sndtimeo
send timeout value
Definition n_network.h:260
struct addrinfo hints
address of local machine
Definition n_network.h:228
int so_keepalive
so keepalive state
Definition n_network.h:252
netw_func send_data
send func ptr
Definition n_network.h:284
int addr_infos_loaded
Internal flag to know if we have to free addr infos.
Definition n_network.h:244
uint32_t state
state of the connection , NETW_RUN, NETW_QUIT, NETW_STOP , NETW_ERR
Definition n_network.h:281
LIST * pools
pointers to network pools if members of any
Definition n_network.h:324
char * key
openssl key file
Definition n_network.h:298
SSL * ssl
SSL handle.
Definition n_network.h:294
int so_linger
close lingering value (-1 disabled, 0 force close, >0 linger )
Definition n_network.h:264
unsigned long int is_blocking
flag to quickly check socket mode
Definition n_network.h:225
int crypto_algo
if encryption is on, which one (flags NETW_ENCRYPT_*)
Definition n_network.h:268
HASH_TABLE * pool
table of clients
Definition n_network.h:331
LIST * send_buf
sending buffer (for outgoing queuing )
Definition n_network.h:305
int mode
NETWORK mode , 1 listening, 0 connecting.
Definition n_network.h:240
int so_rcvbuf
size of the socket recv buffer, 0 untouched, else size in bytes
Definition n_network.h:258
netw_func recv_data
receive func ptr
Definition n_network.h:286
int wait_close_timeout
network wait close timeout value ( < 1 disabled, >= 1 timeout sec )
Definition n_network.h:278
int netw_send_string_to_all(NETWORK *netw, N_STR *name, N_STR *chan, N_STR *txt, int color)
Add a string to the network, aiming all server-side users.
Definition n_network.c:3097
int netw_pool_broadcast(NETWORK_POOL *netw_pool, NETWORK *from, N_STR *net_msg)
add net_msg to all network in netork pool
Definition n_network.c:2956
N_STR * netw_get_msg(NETWORK *netw)
Get a message from aimed NETWORK.
Definition n_network.c:1995
int netw_add_msg(NETWORK *netw, N_STR *msg)
Add a message to send in aimed NETWORK.
Definition n_network.c:1928
ssize_t send_ssl_data(void *netw, char *buf, uint32_t n)
send data onto the socket
Definition n_network.c:2481
char * netw_extract_http_request_type(const char *request)
function to extract the request method from an http request
Definition n_network.c:3186
int netw_get_queue_status(NETWORK *netw, size_t *nb_to_send, size_t *nb_to_read)
retrieve network send queue status
Definition n_network.c:2808
int netw_init_wsa(int mode, int v1, int v2)
Do not directly use, internal api.
Definition n_network.c:693
ssize_t send_php(SOCKET s, int _code, char *buf, int n)
send data onto the socket
Definition n_network.c:2614
int netw_stop_thr_engine(NETWORK *netw)
Stop a NETWORK connection sending and receing thread.
Definition n_network.c:2340
char * netw_urlencode(const char *str, size_t len)
function to perform URL encoding
Definition n_network.c:3153
void * netw_send_func(void *NET)
Thread send function.
Definition n_network.c:2102
NETWORK * netw_accept_nonblock_from(NETWORK *from, int blocking)
make a normal blocking 'accept' .
Definition n_network.c:1918
int netw_get_url_from_http_request(const char *request, char *url, size_t size)
Helper function to extract the URL from the HTTP request line.
Definition n_network.c:3301
#define N_ENUM_netw_code_type(_)
Network codes definition.
Definition n_network.h:192
int netw_set_crypto(NETWORK *netw, char *key, char *certificate)
activate SSL encryption on selected network, using key and certificate
Definition n_network.c:1160
int netw_get_http_date(char *buffer, size_t buffer_size)
helper function to generate the current date in HTTP format
Definition n_network.c:3510
NETWORK_POOL * netw_new_pool(size_t nb_min_element)
return a new network pool of nb_min_element
Definition n_network.c:2827
int netw_set_user_id(NETWORK *netw, int id)
associate an id and a network
Definition n_network.c:2997
ssize_t recv_data(void *netw, char *buf, uint32_t n)
recv data from the socket
Definition n_network.c:2430
int netw_init_openssl(void)
Do not directly use, internal api.
Definition n_network.c:1116
ssize_t recv_ssl_data(void *netw, char *buf, uint32_t n)
recv data from the socket
Definition n_network.c:2547
int netw_make_listening(NETWORK **netw, char *addr, char *port, int nbpending, int ip_version)
Make a NETWORK be a Listening network.
Definition n_network.c:1644
int netw_start_thr_engine(NETWORK *netw)
Start the NETWORK netw Threaded Engine.
Definition n_network.c:2067
int netw_destroy_pool(NETWORK_POOL **netw_pool)
free a NETWORK_POOL *pool
Definition n_network.c:2846
int netw_build_http_response(N_STR **http_response, int status_code, const char *server_name, const char *content_type, char *additional_headers, N_STR *body)
function to dynamically generate an HTTP response
Definition n_network.c:3542
void * netw_recv_func(void *NET)
To Thread Receiving function.
Definition n_network.c:2223
size_t htonst(size_t value)
host to network size_t
Definition n_network.c:30
int netw_unload_openssl(void)
Do not directly use, internal api.
Definition n_network.c:1140
ssize_t(* netw_func)(void *, char *, uint32_t)
send/recv func ptr type
Definition n_network.h:213
size_t netw_pool_nbclients(NETWORK_POOL *netw_pool)
return the number of networks in netw_pool
Definition n_network.c:2980
NETWORK * netw_accept_from_ex(NETWORK *from, size_t send_list_limit, size_t recv_list_limit, int blocking, int *retval)
make a normal 'accept' .
Definition n_network.c:1753
int SOCKET
default socket declaration
Definition n_network.h:61
int netw_setsockopt(NETWORK *netw, int optname, int value)
Modify common socket options on the given netw.
Definition n_network.c:794
int netw_set(NETWORK *netw, int flag)
Restart or reset the specified network ability.
Definition n_network.c:1409
ssize_t send_data(void *netw, char *buf, uint32_t n)
send data onto the socket
Definition n_network.c:2379
int netw_get_state(NETWORK *netw, uint32_t *state, int *thr_engine_status)
Get the state of a network.
Definition n_network.c:1388
void netw_pool_netw_close(void *netw_ptr)
close a network from a network pool
Definition n_network.c:2865
size_t netw_calculate_urlencoded_size(const char *str, size_t len)
function to calculate the required size for the URL-encoded string
Definition n_network.c:3130
int deplete_send_buffer(int fd, int timeout)
wait until the socket is empty or timeout, checking each 100 msec.
Definition n_network.c:1472
NETWORK * netw_accept_from(NETWORK *from)
make a normal blocking 'accept' .
Definition n_network.c:1908
int netw_close(NETWORK **netw)
Closing a specified Network, destroy queues, free the structure.
Definition n_network.c:1503
int netw_send_quit(NETWORK *netw)
Add a formatted NETMSG_QUIT message to the specified network.
Definition n_network.c:3113
const char * netw_get_http_status_message(int status_code)
helper function to convert status code to a human-readable message
Definition n_network.c:3486
int netw_set_blocking(NETWORK *netw, unsigned long int is_blocking)
Modify blocking socket mode.
Definition n_network.c:739
int netw_send_string_to(NETWORK *netw, int id_to, N_STR *name, N_STR *chan, N_STR *txt, int color)
Add a string to the network, aiming a specific user.
Definition n_network.c:3077
int netw_send_ping(NETWORK *netw, int type, int id_from, int id_to, int time)
Add a ping reply to the network.
Definition n_network.c:3012
int netw_ssl_connect(NETWORK **netw, char *host, char *port, int ip_version, char *ssl_key_file, char *ssl_cert_file)
Use this to connect a NETWORK to any listening one, unrestricted send/recv lists.
Definition n_network.c:1375
NETWORK_HTTP_INFO netw_extract_http_info(char *request)
extract a lot of informations, mostly as pointers, and populate a NETWORK_HTTP_INFO structure
Definition n_network.c:3219
int netw_connect(NETWORK **netw, char *host, char *port, int ip_version)
Use this to connect a NETWORK to any listening one, unrestricted send/recv lists.
Definition n_network.c:1359
__netw_code_type
Network codes declaration.
Definition n_network.h:210
int netw_send_ident(NETWORK *netw, int type, int id, N_STR *name, N_STR *passwd)
Add a formatted NETWMSG_IDENT message to the specified network.
Definition n_network.c:3031
char * netw_urldecode(const char *str)
Function to decode URL-encoded data.
Definition n_network.c:3338
int netw_pool_add(NETWORK_POOL *netw_pool, NETWORK *netw)
add a NETWORK *netw to a NETWORK_POOL *pool
Definition n_network.c:2878
int netw_info_destroy(NETWORK_HTTP_INFO http_request)
destroy a NETWORK_HTTP_INFO loaded informations
Definition n_network.c:3288
HASH_TABLE * netw_parse_post_data(const char *post_data)
Function to parse POST data.
Definition n_network.c:3375
const char * netw_guess_http_content_type(const char *url)
function to guess the content type based on URL extension
Definition n_network.c:3422
ssize_t recv_php(SOCKET s, int *_code, char **buf)
recv data from the socket
Definition n_network.c:2697
int netw_send_position(NETWORK *netw, int id, double X, double Y, double vx, double vy, double acc_x, double acc_y, int time_stamp)
Add a formatted NETWMSG_IDENT message to the specified network.
Definition n_network.c:3055
int netw_pool_remove(NETWORK_POOL *netw_pool, NETWORK *netw)
remove a NETWORK *netw to a NETWORK_POOL *pool
Definition n_network.c:2921
int netw_add_msg_ex(NETWORK *netw, char *str, unsigned int length)
Add a message to send in aimed NETWORK.
Definition n_network.c:1959
Structure of a N_SOCKET.
Definition n_network.h:216
Structure of a NETWORK.
Definition n_network.h:236
structure for splitting HTTP requests
Definition n_network.h:339
structure of a network pool
Definition n_network.h:329
Common headers and low-level functions & define.
Hash functions and table.
List structures and definitions.
N_STR and string function declaration.
Timing utilities.