Re: [Boost-users] boost::asio::read() gets stuck when there's no internet

2021-02-20 Thread Richard Hodges via Boost-users
On Sat, 20 Feb 2021 at 10:56, Child OfGod via Boost-users < boost-users@lists.boost.org> wrote: > Thanks Niall, I tried adding this to the code: > > [code] > boost::asio::socket_base::keep_alive ka_option(true); > socket.lowest_layer().set_option(ka_option); > [/code] > > and now it someti

Re: [Boost-users] boost::asio::read() gets stuck when there's no internet

2021-02-20 Thread Child OfGod via Boost-users
Thanks Niall, I tried adding this to the code: [code] boost::asio::socket_base::keep_alive ka_option(true); socket.lowest_layer().set_option(ka_option); [/code] and now it sometimes can come out of the read with an exception raised, which is good, but this happens only once in a while. I

Re: [Boost-users] boost::asio::read() gets stuck when there's no internet

2021-02-19 Thread Niall Douglas via Boost-users
On 19/02/2021 17:19, Richard Hodges via Boost-users wrote: > The TCP/IP protocol was designed to work over unreliable networks, > including sections that hop over radio links and dial-up telephone lines. > > In a nutshell, the way the internet works is that packets are > transmitted and it is assu

Re: [Boost-users] boost::asio::read() gets stuck when there's no internet

2021-02-19 Thread Richard Hodges via Boost-users
The TCP/IP protocol was designed to work over unreliable networks, including sections that hop over radio links and dial-up telephone lines. In a nutshell, the way the internet works is that packets are transmitted and it is assumed that they may or may not arrive at some time in the future. There

[Boost-users] boost::asio::read() gets stuck when there's no internet

2021-02-19 Thread Child OfGod via Boost-users
In TgBot library i use under MSVC++, in tgbot/net/BoostHttpOnlySslClient.cpp, a call to boost::asio::read() does not return when internet is disconnected for a few minutes. I would appreciate any help to get this resolved, i.e. for the read function to return if it fails after some timeout has pas