From: Ville Mattila Date: 2005-07-24T15:15:58+09:00 Subject: Re: Gem hangs => TCPSocket.write hangs Do you happen to have zonealarm or some other personal firewall installed. The behaviour you are having seems to be one that have been reported previously causing by ZA. - Ville Tim Shadel writes: > Well, I tried deleting the cache and that didn't work. So I dug in > and tried to find the call that was hanging. I eventually traced it > down to the TCPSocket.write call inside the HTTP module. Here's a > snippet from irb that shows the problem: > > C:\>irb > irb(main):001:0> require 'socket' > => true > irb(main):002:0> sock = TCPSocket.new("gems.rubyforge.org", 80) > => # > irb(main):003:0> sock.write "GET /yaml.Z HTTP/1.1\r\nHost: > gems.rubyforge.org\r\n\r\n" > > (Hangs) > > I also tried to write a small script to show the problem. > > ------- > require 'socket' > > hostname = ARGV[0] > puts "Making socket to #{hostname}" > sock = TCPSocket.new(hostname, 80) > mesg = "GET /yaml.Z HTTP/1.1\r\nHost: #{hostname}\r\n\r\n" > puts "writing to socket #{hostname}: " + mesg > sock.write mesg > puts "Wow, no hang!" > ----- > > Here's the output: > > ------ > C:\>ruby test.rb google.com > Making socket to google.com > writing to socket google.com: GET /yaml.Z HTTP/1.1 > Host: google.com