From: Bertram Scharpf Date: 2005-01-07T07:43:28+09:00 Subject: Re: HTTP doesn't work. A bug? Hi, Am Donnerstag, 30. Dez 2004, 08:43:52 +0900 schrieb Bertram Scharpf: > Hi all, > > downloading a larger file, I encounter this error message: > > /usr/lib/ruby/1.8/net/protocol.rb:197:in `sysread': End of file reached (EOFError) > > The error happens only with a download through a modem. In > my small home network everything works properly. I use > Apache 1.3.26. Outside, I tried to load from 1.3.29 and 2.0 > versions. I examined the problem thoroughly and now, I can reproduce it reliably. What I have to do is starting several instances of wget -o /dev/null -O /dev/null http://www.ruby-doc.org/downloads/ruby-doc-bundle.tar.gz Then, the program below dies when loading the first file the second time. I tried it with a maximum of debugging output, I even hacked the interpreter to get some more. I diff'ed the results against those of the run without the parallel downloads. I didn't find any hint. Of course, the program works when I omit the `conn.start' statement, but I think it should get along with it. The problem seems to be compiler-independent (GNU C 2.95 and 3.3). Could anyone who knows more about socket connections please have a look at the problem. I will provide any further information. Bertram ------------------------------ require 'net/http' s, t = [ 'www.rayninfo.co.uk', 'www.ruby-doc.org'] f, g = [ '/vimtips.html', '/docs/CLR-FAQ/ruby_newsgroup_faq.txt'] c, d = [ s, t].collect { |host| Net::HTTP.new host } [ c, d].each { |conn| conn.start } 100.times do |n| [ [c,f], [d,g]].each do |conn,file| conn.request_get file do |resp| resp.read_body do |buf| end end end end -- Bertram Scharpf Stuttgart, Deutschland/Germany http://www.bertram-scharpf.de