9#define DELAY_BETWEEN_SOCKET_RETRIES MSEC(100)
15#define TCP_TIMEOUT_TIME SEC(10)
21#define UDP_TIMEOUT_TIME SEC(1)
26#define CONNECT_RETRY_INTERVAL MSEC(500)
33#define CONNECT_TIMEOUT MINUTES(1)
40#define MAX_NUM_PORT_ADDRESSES 16u
49#define PORT_BIND_RETRY_INTERVAL SEC(1)
54#define PORT_BIND_RETRY_LIMIT 60
62#define DEFAULT_PORT 15045u
67#define MSG_TYPE_FAILED 25
106 bool increment_port_on_retry);
void * lf_mutex_t
Definition lf_arduino_support.h:118
int create_real_time_tcp_socket_errexit()
Create an IPv4 TCP socket with Nagle's algorithm disabled (TCP_NODELAY) and Delayed ACKs disabled (TC...
Definition socket_common.c:27
int accept_socket(int socket, int rti_socket)
Definition socket_common.c:187
socket_type_t
Definition socket_common.h:69
@ TCP
Definition socket_common.h:69
@ UDP
Definition socket_common.h:69
int connect_to_socket(int sock, const char *hostname, int port)
Definition socket_common.c:219
int read_from_socket_close_on_error(int *socket, size_t num_bytes, unsigned char *buffer)
Definition socket_common.c:301
int create_server(uint16_t port, int *final_socket, uint16_t *final_port, socket_type_t sock_type, bool increment_port_on_retry)
Create a TCP server that listens for socket connections.
Definition socket_common.c:136
int read_from_socket(int socket, size_t num_bytes, unsigned char *buffer)
Definition socket_common.c:273
void read_from_socket_fail_on_error(int *socket, size_t num_bytes, unsigned char *buffer, lf_mutex_t *mutex, char *format,...)
Definition socket_common.c:317
void write_to_socket_fail_on_error(int *socket, size_t num_bytes, unsigned char *buffer, lf_mutex_t *mutex, char *format,...)
Definition socket_common.c:386
lf_mutex_t socket_mutex
Definition socket_common.c:25
ssize_t peek_from_socket(int socket, unsigned char *result)
Definition socket_common.c:337
int write_to_socket(int socket, size_t num_bytes, unsigned char *buffer)
Definition socket_common.c:345
int write_to_socket_close_on_error(int *socket, size_t num_bytes, unsigned char *buffer)
Definition socket_common.c:371
char buffer[BUFFER_SIZE]
Definition trace_util.c:42