From: Dossy Date: 2002-06-17T22:54:23+09:00 Subject: Re: Kernel#select questions On 2002.06.17, nobu.nokada@softhome.net wrote: > Hi, > > At Mon, 17 Jun 2002 12:16:17 +0900, > Wilkes Joiner wrote: > > Win2K, Ruby 1.6.7 from Pragmatic Programmers > > > > require 'socket' > > server = TCPServer.new('localhost', 8088) > > Thread.new { Thread.pass while true } # comment this line and it works > > correctly > > p select([server],nil, nil, 1) while true > > I guess it's [ruby-talk:40015]. I think I was wrong in [ruby-talk:40015] -- although, I can't verify it now. On Linux, #select returns nil on timeout. Maybe on Win32 it returns [[], [], []] ... I can't remember. I just ran Wilkes's test case on Linux, and #select returns nil even with the Thread.new line not commented out. I think the problem has to do with threading interfering with #select on Win32. [ruby-talk:40221] reminds me of this ... and the next message [ruby-talk:40279] you post a patch. -- Dossy -- Dossy Shiobara mail: dossy@panoptic.com Panoptic Computer Network web: http://www.panoptic.com/ "He realized the fastest way to change is to laugh at your own folly -- then you can let go and quickly move on." (p. 70)