From: mrchameleon@... (Chris Reay) Date: 2004-06-11T08:14:08+09:00 Subject: Re: oddities with select Ben Giddings wrote in message news:<40C87DCC.5050309@infofiend.com>... > Chris Reay wrote: > >>irb(main):015:0> [[sock], [], []] == true > >>=> false > >> Wow. This *is* hard yakka. if select([@sock], [], [], 0.1) @sock.recv() etc, etc. Your program is asking the "recv" block to be called if select() returns true. We have established the following: (a) select() returns nil or anArray (from a RTFM). (b) nil != true (axiom). (c) anArray != true. (See your irb snippet above). Thus you are requesting the block never to be called. Your program is working perfectly, and the socket is brimming with bytes :) Try this (and pardon my ruby, I've forgotten most of the syntax): while true sockArr = select([@sock], [], [], 0.1) if !sockArr.nil? and sockArr.at(0).include?(@sock) @sock.recv(256) etc, etc. Pardon my didactic tone too. I hope this helps. Yours Chris