|
Boost : |
From: JH (jupiter.hce_at_[hidden])
Date: 2019-11-01 10:10:28
On 11/1/19, JH <jupiter.hce_at_[hidden]> wrote:
> 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::stream<boost::asio::ip::tcp::socket>, how could
> I get socket file handler number from the boost asio socket?
I should say the socket file descriptor.
> Thank you.
>
> Kind regards,
>
> - jh
>
> On 10/31/19, JH <jupiter.hce_at_[hidden]> wrote:
>> 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
>>
>
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk