I have a C ++ boost client that blocks the connection and processes the message after receiving a response. I got a strange problem.
tcp::resolver::query query(tcp::v6(), this->host, port,tcp::resolver::query::v4_mapped); iterator = resolver.resolve(query); socket = new tcp::socket(io_service); socket->connect(*iterator);
I tried to connect to a machine inaccessible to ping6 (but IPV6 was enabled). However, I did not get any errors when trying to resolve the request in line-2. As a result, it takes too much time when trying to connect before giving an error. My questions: -
1) Can a timeout block a connection from asio? I cannot switch to asynchronous mode of operation.
2) Why don't I get an error when it resolves an unreachable host?
Any advice would be very helpful.
source share