lib/async/io/host_endpoint.rb in async-io-1.18.4 vs lib/async/io/host_endpoint.rb in async-io-1.18.5
- old
+ new
@@ -47,9 +47,10 @@
last_error = nil
Addrinfo.foreach(*@specification) do |address|
begin
return Socket.connect(address, **@options, &block)
+ # This is a little bit risky. In theory, what it is supposed to do is catch the failed connection, and try the next address. In practice, it can catch other kinds of failures. Ideally, it only applies to `#connect`, but it also applies to what's executed in `&block`.
rescue
last_error = $!
end
end