matz / zetabits.com (Yukihiro Matsumoto) writes:

> FYI, the latest 1.7.0 do not use call dup(2) on sockets, it uses one
> connection instead of two.

E:\projects\ruby>type foo.rb
#! /usr/bin/env ruby

require 'net/http'

http = Net::HTTP.new(address = 'www.pragmaticprogrammer.com')
begin
  response, body = http.get('/index.html')
  puts body
rescue Net::ProtoRetriableError => err
  err.data.each { |k,v| puts "#{k} #{v}" }
end

E:\projects\ruby>h:\ruby17\bin\ruby.exe -v foo.rb
ruby 1.7.0 (2001-02-24) [i686-cygwin]
/h/ruby17/lib/ruby/1.7/net/http.rb:659: warning: ambiguous first argument; make
sure
/h/ruby17/lib/ruby/1.7/net/protocol.rb:506:in `new': Invalid argument - "connect
(2)" (Errno::EINVAL)
        from /h/ruby17/lib/ruby/1.7/net/protocol.rb:506:in `connect'
        from /h/ruby17/lib/ruby/1.7/net/protocol.rb:505:in `timeout'
        from /h/ruby17/lib/ruby/1.7/net/protocol.rb:505:in `connect'
        from /h/ruby17/lib/ruby/1.7/net/protocol.rb:499:in `initialize'
        from /h/ruby17/lib/ruby/1.7/net/protocol.rb:200:in `new'
        from /h/ruby17/lib/ruby/1.7/net/protocol.rb:200:in `conn_socket'
        from /h/ruby17/lib/ruby/1.7/net/protocol.rb:189:in `connect'
        from /h/ruby17/lib/ruby/1.7/net/protocol.rb:183:in `_start'
        from /h/ruby17/lib/ruby/1.7/net/protocol.rb:176:in `start'
        from /h/ruby17/lib/ruby/1.7/net/http.rb:441:in `common_oper'
        from /h/ruby17/lib/ruby/1.7/net/http.rb:426:in `request'
        from /h/ruby17/lib/ruby/1.7/net/http.rb:399:in `get'
        from foo.rb:7

-- 
Jonathan Feinberg   jdf / pobox.com   Sunny Brooklyn, NY
http://pobox.com/~jdf