Libwebsockets unable to try second address when LWS_WITH_SYS_ASYNC_DNS=1
JosephTharayil opened this issue · comments
Hi,
I guess this is more of a query than an issue, i have enabled these two options in the library -DLWS_IPV6=ON and -DLWS_WITH_SYS_ASYNC_DNS=1. What i am noticing is that i am able to get two ip address in the cache both ipv4 and ipv6 and ipv6 is index 0 and ipv4 is index 1 in the cache. So the library selects ipv6 and tries to establish a connection but it fails and the callback LWS_CALLBACK_CLIENT_CONNECTION_ERROR: is executed. But now i am expecting the library to take the next ipv4 address and try the connection with that, but it seems to go back to index0 and use ipv6 only. Does the library support trying multiple ip's when one fails or is it left to the user to maintain the reference of which failed and then move to the next ip address. I am using a slightly older version of the library 4.3.2.
maybe another way of putting it is should i implement my own logic for switching between ip's using this api call lws_async_dns_query()?
Thanks,
This did have some work on it a couple of years ago, you should try main branch.
This did have some work on it a couple of years ago, you should try main branch.
oh so the library internally does support this functionality to automatically switch between ip's and i don't have to write my own logic using lws_async_dns_query()? Sorry if i am repeating the question you really quick to respond. :)
Even with the main branch its not switching to the ipv4 address,
i see this error
LWS_CLIENT[3223]: [wsicli|13|WS/h1/default/device.test.cloud]: lws_client_connect_via_info: adoption cb 19 to h1 protocol_tunnel
LWS_CLIENT[3223]: Reason code : 19 is received in callback callback_abc func
LWS_CLIENT[3223]: [wsicli|12|WS/h1/default/device.test.cloud]: lws_sul_wsitimeout_cb: TIMEDOUT WAITING 8, dhdr 0, ah 0x2da8d0, wl 0
LWS_CLIENT[3223]: [callback]: LWS_CALLBACK_CLIENT_CONNECTION_ERROR: Timed out waiting SSL
but using the netstat command i see we are still in SYN_SENT phase for ipv6. Also can i know the answer to my previous question. Or does the library support the switch but it doesn't seem to work for some reason?
You're timing out the whole connection allowance on the ipv6 one by the look of it.
Main supports dns result scoring and sorting according to some RFC I forget.
Does it support whatever is giving you trouble? Who knows.