From: Roger Pack Date: 2007-08-15T04:23:29+09:00 Subject: Re: TCPSocket select method Eric Hodel wrote: > On Aug 13, 2007, at 23:54, Sylvain Joyeux wrote: > >>> chance what the 'internal' select method does? >> It cannot use IO.select since IO.select is a singleton method of IO >> and a >> TCPSocket object is an instance of IO. The only way to explicitely get >> IO.select is to call >> r,w,e = IO.select(...) >> >> It calls Kernel#select. And I wouldn't be surprised if >> Kernel#select and >> IO.select were actually the same method ... > > They are. class TCPSocket def readableNow? r,w,e = select([self],nil,nil,0) return r != nil end end So...follow up question: with the above code, if you try to run it, it says that "select takes 0 arguments, 4 given" (whereas 'normally' select takes four). If I replace the call to select (above), with IO.select, then it works with 4 parameters. So I am thinking it is a different 'internal' select function of some type. So...my guess is it is not a call to IO.select or Kernel.select...hmm... -- Posted via http://www.ruby-forum.com/.