warmcat / libwebsockets

canonical libwebsockets.org networking library
https://libwebsockets.org
Other
4.65k stars 1.46k forks source link

Websocket Ping / PONG sending out after every 5 mint #3158

Open sush126 opened 4 weeks ago

sush126 commented 4 weeks ago

Hi @lws-team,

I am working on a client application where I have set the following retry policies using the API:

lws_client_connect_via_info(pCcInfo);

lws_retry_bo_t retry = { .secs_since_valid_ping = 12, / force PINGs after 12 secs idle / .secs_since_valid_hangup = 14, / hangup after 14 secs idle / }; Additionally, I am resetting these retry policies every 10 seconds if I find a valid probe. However, I still see PING messages being sent by libwebsockets after every 5 minutes.

i am using lws_validity_confirmed() api to reset this retry .

Could you please suggest any thing if i missed here ?

lws-team commented 4 weeks ago

Are you actually using retry somewhere to pass it to lws?

sush126 commented 4 weeks ago

I am using the lws_client_connect_via_info API to configure retry policies for my client connection. Before calling this API, I have created a virtual host (vhost) and passed it to lws_client_connect_via_info.

lws-team commented 4 weeks ago

Does it help to pass it in the context creation struct instead?

sush126 commented 4 weeks ago

Do you mean to say I should pass this retry policy in the structure struct lws_context_creation_info *info? Also, I am calling lws_create_vhost after creating the context. Should I pass this retry policy in the lws_create_vhost API?