From: Dominik Werder Date: 2003-05-16T18:51:48+09:00 Subject: Re: TCP Sockets > Dominik Werder wrote: >> How can I tell how many bytes can be read from an IO object without >> blocking? > > IO#ready? of io/wait library in rough returns it. > > cvs -d:pserver:anonymous@cvs.ruby-lang.org:/src co rough/ext/io > or > http://www.ruby-lang.org/cgi-bin/cvsweb.cgi/rough/ext/io/io.zip?tarball=1 thank you for the hint! Unfortunately this seems to be very buggy. Sometimes it works, but most of the times the function returns nil although there is data available (readable without blocking). Question to all: Why is something like this not standard and thouroughly tested? Are threads the only practical solution of this problem? thanks! Dominik