TCP Keepalive not working

BotondColop
Posts: 19
Joined: Tue May 10, 2022 6:46 am

TCP Keepalive not working

Postby BotondColop » 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".

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.

ESP_YJM
Posts: 300
Joined: Fri Feb 26, 2021 10:30 am

Re: TCP Keepalive not working

Postby ESP_YJM » Mon Aug 15, 2022 6:13 am


BotondColop
Posts: 19
Joined: Tue May 10, 2022 6:46 am

Re: TCP Keepalive not working

Postby BotondColop » Tue Aug 16, 2022 6:06 am

Thank you very much 8-)

Who is online

Users browsing this forum: No registered users and 155 guests