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

Utilities for opening sockets. More...

#include <errno.h>
#include <netinet/in.h>
#include <netdb.h>
#include <netinet/tcp.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <sys/socket.h>
#include "socket.h"
#include "logger.h"
Include dependency graph for socket.c:

Go to the source code of this file.

Macros

#define LOG_TAG   "socket"
 

Typedefs

typedef enum open_type open_type_t
 

Enumerations

enum  open_type { NODELAY, REUSEADDR, NONE }
 

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

Utilities for opening sockets.

Definition in file socket.c.

Macro Definition Documentation

#define LOG_TAG   "socket"

Definition at line 18 of file socket.c.

Typedef Documentation

typedef enum open_type open_type_t

Enumeration Type Documentation

enum open_type
Enumerator
NODELAY 
REUSEADDR 
NONE 

Definition at line 20 of file socket.c.

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: