This commit is contained in:
MichaelDvP
2023-10-22 18:25:40 +02:00
10 changed files with 111 additions and 95 deletions

View File

@@ -85,7 +85,7 @@ typedef struct {
} lwip_event_packet_t;
static QueueHandle_t _async_queue;
static TaskHandle_t _async_service_task_handle = NULL;
static TaskHandle_t _async_service_task_handle = NULL;
SemaphoreHandle_t _slots_lock;
@@ -1084,13 +1084,13 @@ bool AsyncClient::getNoDelay() {
return tcp_nagle_disabled(_pcb);
}
void AsyncClient::setKeepAlive(uint32_t ms, uint8_t cnt){
if(ms!=0) {
void AsyncClient::setKeepAlive(uint32_t ms, uint8_t cnt) {
if (ms != 0) {
_pcb->so_options |= SOF_KEEPALIVE; //Turn on TCP Keepalive for the given pcb
// Set the time between keepalive messages in milli-seconds
_pcb->keep_idle = ms;
_pcb->keep_idle = ms;
_pcb->keep_intvl = ms;
_pcb->keep_cnt = cnt; //The number of unanswered probes required to force closure of the socket
_pcb->keep_cnt = cnt; //The number of unanswered probes required to force closure of the socket
} else {
_pcb->so_options &= ~SOF_KEEPALIVE; //Turn off TCP Keepalive for the given pcb
}