![]() |
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"
Include dependency graph for ex_network.h:
This graph shows which files directly or indirectly include this file:Go to the source code of this file.
Macros | |
| #define | NETMSG_DATA 1 |
| type of data message | |
Functions | |
| int | get_net_datas (N_STR *str, N_STR **hostname, N_STR **data) |
| decode data we got from network | |
| void * | manage_client (void *ptr) |
| recv/send datas if any for the client | |
| int | send_net_datas (NETWORK *netw, N_STR *data) |
| send data to specified network | |
| #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 80 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().
Here is the call graph for this function:
Here is the caller graph for this function:| void * manage_client | ( | void * | ptr | ) |
recv/send datas if any for the client
| ptr | pointer to the client structure to manage |
Definition at line 115 of file ex_network.h.
References N_STR::data, free_nstr, get_net_datas(), N_SOCKET::ip, NETWORK::link, LOG_ERR, LOG_NOTICE, n_log, NETMSG_DATA, netw_close(), netw_get_msg(), netw_get_state(), netw_msg_get_type(), netw_start_thr_engine(), send_net_datas(), N_SOCKET::sock, and u_sleep().
Here is the call graph for this function:send data to specified network
| netw | the target network |
| data | the data to send |
Definition at line 31 of file ex_network.h.
References __n_assert, add_int_to_msg(), add_nstrdup_to_msg(), add_nstrptr_to_msg(), create_msg(), N_STR::data, delete_msg(), free_nstr, N_STR::length, LOG_DEBUG, LOG_ERR, make_str_from_msg(), n_log, NETMSG_DATA, netw_add_msg(), new_nstr(), and N_STR::written.
Referenced by manage_client().
Here is the call graph for this function:
Here is the caller graph for this function: