Hi there,
By coincidence, I ended up looking at a stack trace where my application calls async_connect() on a asio::ip::tcp::socket. Two things took me by surprise:
1. Asio calls listen() under the hood. Why does it do that when I'm just trying to make an outbound TCP connection?
2. If the listen() call above is indeed required, why does it happen on the same thread where I call async_connect()? I thought the point of the method was to defer the work to the reactor? (For what it's worth, I've had a case on a customer's machine where the call to listen() would hang for 30 seconds before returning -- probably because of a bad firewall -- causing my entire app to hang since the code assumes async_connect() is indeed async.)
I've included the full stack trace below.