Skip to content

Instantly share code, notes, and snippets.

@mpapis
Created March 23, 2012 01:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mpapis/2166048 to your computer and use it in GitHub Desktop.
Save mpapis/2166048 to your computer and use it in GitHub Desktop.
--- a/nntp.rb 2010-04-19 12:23:51.000000000 +0200
+++ b/nntp.rb 2010-04-19 12:23:37.000000000 +0200
@@ -397,8 +397,10 @@
@read_timeout, @debug_output)
else
- @socket = InternetMessageIO.open(@address, @port, @open_timeout,
- @read_timeout, @debug_output)
+ socket = timeout(@open_timeout) { TCPSocket.open(@address, @port) }
+ @socket = InternetMessageIO.new(socket)
+ @socket.read_timeout = @read_timeout
+ @socket.debug_output = @debug_output
end
check_response(critical { recv_response() })
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment