Project

General

Profile

Actions

Bug #10788

closed

Timeout not work with socket

Added by dashi6174 (邓 打师) about 9 years ago. Updated over 4 years ago.

Status:
Closed
Target version:
-
ruby -v:
ruby 2.0.0p481 (2014-05-08) [x64-mingw32]
[ruby-core:67840]

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) about 9 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.

Actions #2

Updated by jeremyevans0 (Jeremy Evans) over 4 years ago

  • Status changed from Open to Closed
Actions

Also available in: Atom PDF

Like0
Like0Like0