Forum: JRuby Question about adding timeout on RubyTCPSocket#initialize

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Atsushi SAKAI (Guest)
on 2012-07-09 12:48
(Received via mailing list)

 I met an freeze error on RubyTCPSocket#initialize.
The problem is that RubyThread#select never returns, which is used in

To solve this issue, I want to set "timeout" in #initialize on
(Corresponds line 110 of following code)

110                context.getThread().select(channel, this,

Is there any idea to solve this problem?

Atsushi SAKAI
Atsushi SAKAI (Guest)
on 2012-07-10 13:01
(Received via mailing list)

 My request is something like attached patch.
The problem is #initialize does not have argument "timeout".
How should I treat about timeout? fixed value is OK?

Atsushi SAKAI

On Mon, 9 Jul 2012 19:46:54 +0900
Hiroshi Nakamura (Guest)
on 2012-07-20 01:55
(Received via mailing list)
Hi SAKAI-san,

In Ruby, you need to use Timeout library like;

require 'timeout'
sock = nil
timeout(60) do
  sock =, port)

So "an freeze error" would not be an error in Ruby.

Can you show us the actual error (with stacktrace) you got?

// NaHi
This topic is locked and can not be replied to.