Shay Hawkins wrote:
> Ryan Davis wrote:
>> ri StringIO
> 
> Thanks, but I think I'm missing something:
> 
>> test.rb:15:in 'select': can't convert StringIO to IO (TypeError)
> 
> objectA = StringIO.new("")
> objectB = StringIO.new("")
> ...
> ready = select([objectA,objectB])

Ah, then you want something with a real underlying O/S file descriptor.

  require 'socket'
  a, b = Socket.pair(Socket::AF_UNIX, Socket::SOCK_STREAM, 0)

Then you can select on a while in another thread you write to b (or vice 
versa)

-- 
Posted via http://www.ruby-forum.com/.