From: wolfoxbr@... (Roberto Amorim) Date: 2002-11-15T04:20:50+09:00 Subject: Re: Non-blocking TCPSocket.gets Take a look on Kernel#select, it allows for asynchronous (blocking or non-blocking) check of sockets in general. It's also implemented on the IO class, which is parent of Socket. > Is there a way to find out if there is any data waiting on a TCPSocket? > TCPSocket.gets and getc (and readlines... etc) all block until data arrives > if there is none available, however I want to just check if there's any > there and read it if there is, otherwise go on and do something else. I > cannot see a way in IO, BasickSocket or TCPSocket to do this. Can anyone > point me in the right direction? > > Thanks, > Tim Bates