Nilorea Library
C utilities for networking, threading, graphics
|
Nilorea Library n_network api test. More...
#include <getopt.h>
#include <sys/time.h>
#include <sys/types.h>
#include "nilorea/n_common.h"
#include "nilorea/n_log.h"
#include <sys/wait.h>
#include "nilorea/n_network.h"
#include "nilorea/n_network_msg.h"
#include "nilorea/n_thread_pool.h"
Go to the source code of this file.
Macros | |
#define | NETMSG_DATA 1 |
type of data message More... | |
Functions | |
int | get_net_datas (N_STR *str, N_STR **hostname, N_STR **data) |
decode data we got from network More... | |
void * | manage_client (void *ptr) |
recv/send datas if any for the client More... | |
int | send_net_datas (NETWORK *netw, N_STR *data) |
send data to specified network More... | |
#define NETMSG_DATA 1 |
type of data message
Definition at line 9 of file ex_network.h.
decode data we got from network
str | the string to decode |
hostname | decoded hostname |
data | decoded data |
Definition at line 98 of file ex_network.h.
References __n_assert, delete_msg(), get_int_from_msg(), get_nstr_from_msg(), LOG_DEBUG, LOG_ERR, make_msg_from_str(), n_log, and NETMSG_DATA.
Referenced by manage_client().
void * manage_client | ( | void * | ptr | ) |
recv/send datas if any for the client
ptr | pointer to the client structure to manage |
Definition at line 139 of file ex_network.h.
References free_nstr, get_net_datas(), LOG_ERR, LOG_NOTICE, n_log, NETMSG_DATA, netw_get_msg(), netw_get_state(), netw_msg_get_type(), netw_start_thr_engine(), netw_wait_close(), send_net_datas(), SOCKET, and u_sleep().
send data to specified network
netw | the target network |
data | the data to send |
Definition at line 45 of file ex_network.h.
References __n_assert, add_int_to_msg(), add_nstrdup_to_msg(), add_nstrptr_to_msg(), create_msg(), delete_msg(), free_nstr, LOG_DEBUG, LOG_ERR, make_str_from_msg(), n_log, NETMSG_DATA, netw_add_msg(), and new_nstr().
Referenced by manage_client().