Bug #10788
Timeout not work with socket
Description
Timeout.timeout(1) do
TCPSocket.new "33.2.2.1",333
end
The ip 33.2.2.1 is unreachable, I except it raise Timeout::Error, but
in fact it always raise Errno::ETIMEDOUT!
But I test it on Ubuntu14.04(ruby2.0), it's ok!
Updated by usa (Usaku NAKAMURA) almost 6 years ago
Unfortunately, it's a restriction of WinSock.
You have to use Socket instead of TCPSocket and call Socket#connect_nonblock for your purpose.