Aldric Giacomoni wrote:
> The question is, what does "select" do ? rdocs aren't helpful, and I 
> don't understand that bit of code.

You're right, "ri Kernel#select" and "ri IO::select" are both extremely 
poor.

But it's essentially the same as the C "select" call, which you can read 
about using "man 2 select" if you have the right manpages installed 
(under Ubuntu: sudo apt-get manpages-dev)

It checks a number of IO descriptors for readiness for reading, writing 
or exceptional conditions, and returns when at least one of them is 
ready or a timeout has expired.

    select([@sock, STDIN], nil, nil)

has no timeout parameter so will wait indefinitely. Only read_fds are 
specified, so it will return an array containing either @sock or STDIN 
or both, depending on which of them has data to read.
-- 
Posted via http://www.ruby-forum.com/.