LibGame
v0.4.0
The LG Game Engine - Copyright (C) 2024 ETMSoftware
|
Macros | |
#define | FPRINTF2(stream, ...) |
Functions | |
void | set_send_recv_timeout_sec (int timeout) |
int | get_send_recv_timeout_sec () |
void | set_send_recv_timeout_usec (int timeout) |
int | get_send_recv_timeout_usec () |
void | set_connect_timeout_sec (int timeout) |
int | get_connect_timeout_sec () |
void | set_connect_timeout_usec (int timeout) |
int | get_connect_timeout_usec () |
void | libetm_socket_set_use_proxy (zboolean use_proxy2) |
zboolean | libetm_socket_get_use_proxy () |
sockt | tcp_connect_to_host (const char *host, const char *portnum_str) |
int | writable_data_is_available_on_tcp_socket (sockt sock) |
int | readable_data_is_available_on_tcp_socket (sockt sock) |
int | tcp_send_full (sockt sock, const char *str) |
char * | tcp_recv_full (sockt sock, int *bytes_received, int *status) |
const char * | sock_error_message () |
=== TCP sockets funcs ===
#define FPRINTF2 | ( | stream, | |
... | |||
) |
void set_send_recv_timeout_sec | ( | int | timeout | ) |
...
int get_send_recv_timeout_sec | ( | ) |
...
void set_send_recv_timeout_usec | ( | int | timeout | ) |
...
int get_send_recv_timeout_usec | ( | ) |
...
void set_connect_timeout_sec | ( | int | timeout | ) |
...
int get_connect_timeout_sec | ( | ) |
...
void set_connect_timeout_usec | ( | int | timeout | ) |
...
int get_connect_timeout_usec | ( | ) |
...
void libetm_socket_set_use_proxy | ( | zboolean | use_proxy2 | ) |
Default is not using proxy, otherwise must be set.
zboolean libetm_socket_get_use_proxy | ( | ) |
...
sockt tcp_connect_to_host | ( | const char * | host, |
const char * | portnum_str | ||
) |
Open stream socket in non-blocking mode and connect to host. Return socket fd (> 0) / TCP_SOCK_CREATE_ERROR (-1 on Linux) if error.
int writable_data_is_available_on_tcp_socket | ( | sockt | sock | ) |
...
int readable_data_is_available_on_tcp_socket | ( | sockt | sock | ) |
...
int tcp_send_full | ( | sockt | sock, |
const char * | str | ||
) |
Return n bytes sent or TCP_SOCK_FUNC_ERROR (-1 on Linux) if error (connection closed by server or ?)
char* tcp_recv_full | ( | sockt | sock, |
int * | bytes_received, | ||
int * | status | ||
) |
Return response = tcp_recv_full(socket, &bytes_received, &status) or NULL if error. -> status = TCP_SOCK_OK, CONNECTION_CLOSED_BY_SERVER, TCP_SOCK_FUNC_ERROR or TCP_SOCK_SHOULD_BE_CLOSED. -> allocate memory for response (must be freed afterwards with free2() if != NULL).
const char* sock_error_message | ( | ) |
...