Page 1 of 1

TCP Keepalive not working

Posted: Wed Aug 10, 2022 7:33 am
by BotondColop
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".

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 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.

Re: TCP Keepalive not working

Posted: Mon Aug 15, 2022 6:13 am
by ESP_YJM

Re: TCP Keepalive not working

Posted: Tue Aug 16, 2022 6:06 am
by BotondColop
Thank you very much 8-)