Go to the source code of this file.
Defines | |
#define | SCK_BUFFER_INIT_SIZE 1024 |
Initial number of bytes for the buffer used to read data from a socket. | |
#define | SCK_CREATE_ERROR -1 |
Return value for the function open_tcp_connexion(). This means that the process can not create a new socket (in other words, the system call socket() failed). | |
#define | SCK_CONNECT_ERROR -2 |
Return value for the function open_tcp_connexion(). This means that the process can not connect to the remote server. In other words, the function connect() failed. | |
#define | SCK_GET_IP_ERROR -3 |
Return value for the function open_tcp_connexion(). This means that the process can not get the IP address of the host running the remote server. In other words, the function gethostbyname() failed. | |
#define | SCK_TIMEOUT_CONNECT -4 |
Return value for the function open_tcp_connexion(). This means that the system call connect() has been interrupted by a signal (it should be SIGALRM. | |
#define | SCK_TIMER_ERROR -5 |
Return value for the function open_tcp_connexion(). This means that there was a problem with the high precision timer (that raises the signal SIGALRM). This error should not happen. | |
#define | SCK_CHRONO_ERROR -6 |
Return value for the function open_tcp_connexion(). This means that there was a problem with the high precision chronometer. | |
#define | SCK_READ_OK -7 |
Return value for the function read_all_socket() and read_from_socket(). This means that the function was successful. | |
#define | SCK_READ_NO_MEM -8 |
Return value for the function read_all_socket(). This means that the function can not allocate memory to store the data read from the socket. | |
#define | SCK_READ_READ_ERROR -9 |
Return value for the function read_all_socket() and read_from_socket(). This means that the function failed on the read() system call. | |
#define | SCK_READ_TIMEOUT -10 |
Return value for the function read_all_socket() and read_from_socket(). Read timeout! | |
#define | SCK_READ_CHRONO_ERROR -11 |
Return value for the function read_all_socket() and read_from_socket(). This means that there was a problem with the high precision chronometer. | |
#define | SCK_READ_TIMER_ERROR -12 |
Return value for the function read_all_socket() and read_from_socket(). This means that there was a problem with the high precision timer. | |
#define | SOCKETS_H |
Functions | |
int | open_tcp_connexion (struct sockaddr_in *, char *, int, long, long, unsigned long int *) |
Open a TCP connexion to a remote server. | |
void | Get_Sock_Adress (char *Machine_serveur, int port_serveur, struct sockaddr_in *TCP_address) |
Get the Internet address of a service. | |
int | read_from_socket (int sockfd, char *buffer, size_t buffer_size, size_t *extracted, long tt_sec, long tt_micro, unsigned long int *ellapsed_time) |
Read data from an open socket descriptor (read timeout in micro seconds + ellapsed time in milli seconds). | |
int | read_all_socket (int sockfd, char **buffer, long tt_sec, long tt_micro, unsigned long int *ellapsed_time, unsigned long int *size) |
Read from a socket, until the connexion is closed. |
Definition in file my_sockets.h.
|
Get the Internet address of a service.
Definition at line 141 of file sockets.c. Referenced by open_tcp_connexion(). |
|
Open a TCP connexion to a remote server.
Definition at line 44 of file sockets.c. References Get_Sock_Adress(), SCK_CHRONO_ERROR, SCK_CONNECT_ERROR, SCK_GET_IP_ERROR, SCK_TIMEOUT_CONNECT, and SCK_TIMER_ERROR. Referenced by client_smtp_connect(). |
|
Read from a socket, until the connexion is closed.
Definition at line 259 of file sockets.c. References read_from_socket(), SCK_BUFFER_INIT_SIZE, SCK_READ_NO_MEM, and SCK_READ_OK. |
|
Read data from an open socket descriptor (read timeout in micro seconds + ellapsed time in milli seconds).
Definition at line 167 of file sockets.c. References SCK_READ_CHRONO_ERROR, SCK_READ_OK, SCK_READ_READ_ERROR, SCK_READ_TIMEOUT, and SCK_READ_TIMER_ERROR. Referenced by client_smtp_connect(), read_all_socket(), and smtp_send_email(). |