"Dave Burt" wrote:
>agemoagemo / yahoo.com wrote:
>>(I wish I could find a function that would be like "Okay, give me 
>>*everything* that I could read from the
>>socket right now." Or even just a way to check how
>>much is waiting on the socket... Pretty much everything
>>I've
>>ever tried to do with sockets would be easeir with
>>that.)
>
>socket.read will do that.
>
>Socket < BasicSocket < IPSocket < IO

Are you sure about this?

I just did a little code in a couple irb windows to test this. socket.read
called with an argument doesn't seem to return until it gets as many
characters as the argument specified. And without an argument, it
doesn't seem to return... ever. (Or at least, not until I tell my server to
close the socket. Which kind of defeats the purpose.)

Now, socket.recv, that's a method I've managed to make some use of,
since it'll come back with what it has if I call it with a number larger than
the amount of data available. There are still times when "get everything"
would be nice though, and that doesn't supply it.

-Morgan


-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.344 / Virus Database: 267.10.17/85 - Release Date: 08/30/2005