In article <6.1.1.1.0.20050907223044.05d78068 / mail.the-arc.net>,
  Morgan <taria / the-arc.net> writes:

> Correct me if I'm wrong, but using eof? on a socket would be rather
> useless, wouldn't it?
>
> I'd *really* like to find something that will just tell me if there's data
> waiting on a socket. Something I can use like
>
> someSocket.incoming_data_waiting?

I'm not sure why people want a such method.

What is a situation you need the method?

> And if there's something I can read, I'll get true, and otherwise I'll get
> false. But nothing I've tried seems to work that way.

If it returns false, your program cannot have data from the socket.
So your program cannot do about the data.  If your program has
something to do in such case, there should be some work which doesn't
depend the data.

If the work is done by other threads, the blocking behavior is
appropriate because the other threads is run at the blocking time.

If the program use a event driven framework, the readability test
should be done by the main event loop in the framework.  So the
program don't need the method.

So I guess your program has another situation I don't imagine.

However it is possible to implement the method by IO.select.
-- 
Tanaka Akira