TCP Keepalive not working
Posted: Wed Aug 10, 2022 7:33 am
Hi everybody,
I want to activate with esp-idf-v4.4.1 SO_KEEPALIVE to get communication continuous communication if the ESP is working in AP mode.
To setup/activate without error is not the problem, but with wire shark I can not see and massage with "TCP keep alive".
I make this before call the socket bind function.
I have no idea, how i can activate this, can help anybody?
Maybe some example code where is this function is running well.
Thank you in advance.
Best regards.
I want to activate with esp-idf-v4.4.1 SO_KEEPALIVE to get communication continuous communication if the ESP is working in AP mode.
To setup/activate without error is not the problem, but with wire shark I can not see and massage with "TCP keep alive".
Code: Select all
int optval = 1;
setsockopt(socket_id, SOL_SOCKET, SO_KEEPALIVE, &optval, sizeof(optval));
int optvalue = 2; //s
setsockopt(socket_id, SOL_SOCKET, TCP_KEEPIDLE, &optvalue, sizeof(optvalue));
setsockopt(socket_id, SOL_SOCKET, TCP_KEEPINTVL, &optvalue, sizeof(optvalue));
I have no idea, how i can activate this, can help anybody?
Maybe some example code where is this function is running well.
Thank you in advance.
Best regards.