Skip to content

Instantly share code, notes, and snippets.

@stevef
Created April 23, 2012 18:42
Show Gist options
  • Save stevef/2472983 to your computer and use it in GitHub Desktop.
Save stevef/2472983 to your computer and use it in GitHub Desktop.
25 def connect
26 # Connect nonblock is broken in current versions of JRuby
27 if RUBY_PLATFORM == 'java'
28 require 'timeout'
29 if @connect_timeout
30 Timeout::timeout(@connect_timeout, OperationTimeout) do
31 @socket.connect(@socket_address)
32 end
33 else
34 @socket.connect(@socket_address)
35 end
36 else
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment