Getting incomplete reply from socket

Chad Fowler wrote:

···

On Mon, 13 Oct 2003, Greg Vaughn wrote:

Here’s the ruby I’m using to call it:

def networkSend(tosend)

reply = “”

TCPSocket.open($host, $port) do |aSession|

aSession.send(tosend, 0)

reply = aSession.recv(10000)

end

return reply

end

Greg, can you try aSession.read(10000) instead and see if it works?

I finally got a chance to give it a shot and it works much better.
Thanks!

Maybe I can generalize this lesson and try to learn from it. What is
the preferred method to read from a socket? This obviously has a
timeout associated with it. How is that controlled?

-Greg Vaughn