Hi,
I tried to use setsockopt(socket_fd, SOL_TCP, TCP_USER_TIMEOUT,
&tcpTimeout, sizeof(int)) to set up TCP_USER_TIMEOUT, but stuck with
the boost::asio::ssl::streamboost::asio::ip::tcp::socket, how could
I get socket file handler number from the boost asio socket?
Thank you.
Kind regards,
- jh
On 10/31/19, JH
Hi,
I am using boost asio TCP socket in my device application for network connection in Linux platform.
I am troubled currently by long TCP tmeout issues in a device to switch application between WiFi and 4G LTE.
If my application TCP was connected via 4G LTE initially, when WiFi is available, the network is switched to WiFi, but the application TCP connection would have 30 minutes timeout before it terminated the 4G LTE and reconnects to WiFi. That 30 minutes is too long.
I checked TCP document for TCP_USER_TIMEOUT:
TCP_USER_TIMEOUT Decreasing user timeouts allows applications to "fail fast", if so desired. Otherwise, failure may take up to 20 minutes with the current system defaults in a normal WAN environment.
My question is, in boost asio socket, is there an API to change TCP_USER_TIMEOUT?
Appreciate if showing an example or point me to a document how to do it.
Thank you.
Kind regards,
- jh