19 #ifndef _WIICOM_LIBSOCKET_H
20 #define _WIICOM_LIBSOCKET_H
22 #if (defined (__WIN32__))
23 #pragma comment(lib, "ws2_32.lib")
29 #define ssize_t SSIZE_T
33 #include <sys/types.h>
34 #include <sys/socket.h>
35 #include <netinet/in.h>
37 #include <arpa/inet.h>
38 #include <sys/select.h>
41 #endif //if (defined (__WIN32__))
44 #define SEC_TIMEOUT_CONNECT_SOCKET 5
45 #define SEC_TIMEOUT_RECIV_SOCKET 10
52 uint8_t wiicom_socket_initLibSocket();
void wiicom_socket_set_timeout_reciv(uint8_t sec)
Funzione che imposta il timeout della ricezione dati di un socket.
Definition: wiicom_libsocket.c:100
void wiicom_socket_deinitLibSocket()
Function that de-initialize the socket library Warning! This function is called when not used any mor...
Definition: wiicom_libsocket.c:88
uint8_t wiicom_socket_get_timeout_reciv()
Function that returns the seconds after which you have a timeout when receiving data.
Definition: wiicom_libsocket.c:110
int wiicom_socket_create(int domain, int type, int protocol)
Function that create a socket.
Definition: wiicom_libsocket.c:163
void wiicom_socket_set_address(struct sockaddr_in *socket_address, const char *ip, int port)
Function that set a socket address.
Definition: wiicom_libsocket.c:115
uint8_t wiicom_socket_shutdown(int socket_fd)
Function that shut down a socket.
Definition: wiicom_libsocket.c:396
ssize_t wiicom_socket_notimeout_reciv(int socket_fd, void *buffer, size_t buffer_size)
Function that receives the data transmitted to the socket without timeout.
Definition: wiicom_libsocket.c:372
ssize_t wiicom_socket_reciv(int socket_fd, void *buffer, size_t buffer_size)
Function that receives the data transmitted to the socket with timeout On error or timeout the socket...
Definition: wiicom_libsocket.c:310
void wiicom_socket_set_timeout_conn(uint8_t sec)
Function that sets the connection timeout of a socket.
Definition: wiicom_libsocket.c:95
void wiicom_socket_close(int socket_fd)
Function that close a socket.
Definition: wiicom_libsocket.c:180
uint8_t wiicom_socket_get_timeout_conn()
Function that returns the seconds after which there is a timeout in the connection of a socket...
Definition: wiicom_libsocket.c:105
int wiicom_socket_sendall(int socket_fd, uint8_t *buf, uint16_t *len)
Function that sends a data buffer on socket.
Definition: wiicom_libsocket.c:280
uint8_t wiicom_socket_blocking(int socket_fd, uint8_t b_block)
Funzione che imposta il socket come bloccante o non bloccante.
Definition: wiicom_libsocket.c:127
int wiicom_socket_connect(int socketToConnect, struct sockaddr_in *socketToConnect_addr)
Function that make a socket connection with timeout.
Definition: wiicom_libsocket.c:189