Closed lsattem closed 5 years ago
Thanks for pointing this out. The connect timeout is currently applied only after the TCP session is established. It should also be applied to the session setup.
Would you mind testing https://github.com/vcabbage/amqp/tree/issue169?
That works nicely! Now it drops the attempt after the specified time and gives "i/o timeout". Thanks for the quick response and fix :)
Great! Tagged as v0.12.2.
It does not seem that the option
amqp.ConnConnectTimeout
works properly, or perhaps I'm just misunderstanding it. I connect to an ActiveMQ server via ssh tunnel. When the ssh tunnel is closed, and the server cannot be reached, I'd expect amqp to give up after 30 seconds with ConnConnectTimeout set to 30 seconds. However, it hangs for about 2 minutes before giving up and gives the following error message:connect: connection timed out
My code is as follows:
Sorry if there's already been an issue on this!