AiCPlayer
Interface of aic vm - for rendering aspect, sensors, video records
Macros | Typedefs | Functions
socket.h File Reference

Define socket utilities to simplify networking. More...

#include <sys/socket.h>
Include dependency graph for socket.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define SOCKET_ERROR   -1
 Alias for the recv() return value in case of error. More...
 

Typedefs

typedef int socket_t
 Alias to differenciate between regular ints and socket fds. More...
 

Functions

socket_t open_socket (const char *ip, short port)
 Connect to a host:port couple. More...
 
socket_t open_socket_nodelay (const char *ip, short port)
 Open a socket with TCP_NODELAY. More...
 
socket_t open_socket_reuseaddr (const char *ip, short port)
 Open a socket with SO_REUSEADDR. More...
 

Detailed Description

Define socket utilities to simplify networking.

Definition in file socket.h.

Macro Definition Documentation

#define SOCKET_ERROR   -1

Alias for the recv() return value in case of error.

Definition at line 10 of file socket.h.

Typedef Documentation

typedef int socket_t

Alias to differenciate between regular ints and socket fds.

Definition at line 13 of file socket.h.

Function Documentation

socket_t open_socket ( const char *  ip,
short  port 
)

Connect to a host:port couple.

Parameters
ipIP address to connect to
portTCP port to connect to
Returns
The open socket

Definition at line 29 of file socket.c.

Here is the caller graph for this function:

socket_t open_socket_nodelay ( const char *  ip,
short  port 
)

Open a socket with TCP_NODELAY.

Definition at line 34 of file socket.c.

Here is the caller graph for this function:

socket_t open_socket_reuseaddr ( const char *  ip,
short  port 
)

Open a socket with SO_REUSEADDR.

Definition at line 39 of file socket.c.

Here is the caller graph for this function: