From: ville.mattila@... Date: 2005-02-09T00:32:19+09:00 Subject: Re: windows socket connection freeze Hello, I have tested Nakamura's fix, and it seems to work ok, but the connect error message is not as nice as in 1.8.2 see the output below, c:\data\ruby\bin\ruby -v testing.rb ruby 1.8.2 (2005-01-19) [i386-mswin32] in thread: Tue Feb 08 17:20:11 FLE Standard Time 2005 in thread: Tue Feb 08 17:20:12 FLE Standard Time 2005 connecting...in thread: Tue Feb 08 17:20:13 FLE Standard Time 2005 got: A connection attempt failed because the connected party did not properly re spond after a period of time, or established connection failed because connected host has failed to respond. - connect(2) connected! in thread: Tue Feb 08 17:20:36 FLE Standard Time 2005 in thread: Tue Feb 08 17:20:37 FLE Standard Time 2005 in thread: Tue Feb 08 17:20:38 FLE Standard Time 2005 testing.rb:24:in `join': Interrupt from testing.rb:24 f:\ruby1.9\usr\bin\ruby -v testing.rb ruby 1.9.0 (2005-02-08) [i386-mswin32] in thread: Tue Feb 08 17:20:45 FLE Standard Time 2005 in thread: Tue Feb 08 17:20:46 FLE Standard Time 2005 connecting...in thread: Tue Feb 08 17:20:47 FLE Standard Time 2005 in thread: Tue Feb 08 17:20:48 FLE Standard Time 2005got: Bad file descriptor - connect(2) connected! in thread: Tue Feb 08 17:20:49 FLE Standard Time 2005 in thread: Tue Feb 08 17:20:50 FLE Standard Time 2005 in thread: Tue Feb 08 17:20:51 FLE Standard Time 2005 in thread: Tue Feb 08 17:20:52 FLE Standard Time 2005 in thread: Tue Feb 08 17:20:53 FLE Standard Time 2005 testing.rb:24:in `join': Interrupt from testing.rb:24 here is the testing.rb $stdout.sync = true require 'socket' t = Thread.new do while true puts "in thread: " + Time.now.to_s sleep 1 end end sleep 2 puts "connecting..." begin h = TCPSocket.new('172.16.56.189', 80) # bogus ip rescue Exception => e puts "got: " + e.to_s end puts "connected!" t.join |---------+--------------------------------> | | William Morgan | | | | | | Sent by: William | | | Morgan | | | | | | | | | | | | 02/07/2005 00:37 | | | Please respond to | | | ruby-core | | | | |---------+--------------------------------> >--------------------------------------------------------------------------------------------------------------------------------| | | | To: ruby-core@ruby-lang.org | | cc: | | Subject: Re: windows socket connection freeze | >--------------------------------------------------------------------------------------------------------------------------------| Excerpts from U.Nakamura's mail of 6 Feb 2005 (EST): > It's fixed at CVS HEAD. > If someone reports that there is no problem, I' backport it to 1.8. Thank you. As things stand now, RubyTorrent behaves very poorly on Windows, so I look forward to seeing this fix committed. -- William