Nilorea Library

- Main Page
- Modules
- Data Structures
- Files

- File List
- Globals

All Data Structures Files Functions Variables Typedefs Macros Groups
Data Structures | Macros | Typedefs | Functions
n_network.h File Reference
`#include "n_common.h"`
`#include "n_str.h"`
Include dependency graph for n_network.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

## Data Structures

struct | N_SOCKET
struct | NETWORK

## Macros

#define | NETW_CLIENT 2
#define | NETW_SERVER 4
#define | NETW_RESTART_TIMER 8
#define | NETW_EMPTY_SENDBUF 16
#define | NETW_EMPTY_RECVBUF 32
#define | NETW_RUN -64
#define | NETW_PAUSE -128
#define | NETW_QUIT -256
#define | NETW_STOP -512
#define | NETW_ERROR -1024
#define | NETW_THR_ENGINE_STARTED 2048
#define | NETW_THR_ENGINE_STOPPED 4096

## Typedefs

typedef struct N_SOCKET | N_SOCKET
typedef struct NETWORK | NETWORK

## Functions

int | handle_wsa (int mode, int v1, int v2)
| Do not directly use, internal api. More...
int | netw_set (NETWORK *netw, int flag)
| Restart or reset the specified network ability. More...
int | netw_setsockopt (SOCKET sock, int disable_naggle, int sock_send_buf, int sock_recv_buf)
| Modify common socket options. Enable SO_REUSEADDR. More...
int | netw_tcp_socket (SOCKET *sock)
| Get a new tcp socket. More...
int | netw_connect_ex (NETWORK **netw, char *host, int port, int disable_naggle, int sock_send_buf, int sock_recv_buf, int send_list_limit, int recv_list_limit)
| Use this to connect a NETWORK to any listening one. More...
int | netw_connect (NETWORK **netw, char *host, int port)
| Use this to connect a NETWORK to any listening one, with following defaults: disable_naggle = 0 , untouched sockbufsendsize and sockbufrecvsize and unrestricted sned/recv lists. More...
int | netw_close (NETWORK **netw)
| Closing a specified Network, destroy queues, free the structure. More...
int | netw_stop_thr_engine (NETWORK *netw)
| Stop a NETWORK connection sending and receing thread. More...
int | netw_make_listening (NETWORK **netw, int PORT, int nbpending)
| Make a NETWORK be a Listening network. More...
NETWORK * | netw_accept_from_ex (NETWORK *from, int disable_naggle, int sock_send_buf, int sock_recv_buf, int send_list_limit, int recv_list_limit)
| make a normal 'accept' . Network 'from' must be allocated with netw_make_listening. More...
NETWORK * | netw_accept_from (NETWORK *from)
| make a normal 'accept' . Network 'from' must be allocated with netw_make_listening. More...
int | netw_add_msg (NETWORK *netw, N_STR *msg)
| Add a message to send in aimed NETWORK. More...
N_STR * | netw_get_msg (NETWORK *netw)
| Get a message from aimed NETWORK. More...
N_STR * | netw_wait_msg (NETWORK *netw, int refresh, int timeout)
| Wait a message from aimed NETWORK. Recheck each usec until a valid. More...
int | netw_start_thr_engine (NETWORK *netw)
| Start the NETWORK netw Threaded Engine. Create a sending & receiving thread. More...
void * | netw_send_func (void *NET)
| Thread send function. More...
void * | netw_recv_func (void *NET)
| To Thread Receiving function. More...
int | send_data (SOCKET s, char *buf, NSTRBYTE n)
| send data onto the socket More...
int | recv_data (SOCKET s, char *buf, NSTRBYTE n)
| recv data from the socket More...

## Detailed Description

Network Engine

Author
  Castagnier Mickael

Version
  2.0

Date
  11/03/2015

Definition in file n_network.h.