I am connecting to a server and then waiting to receive messages over
the socket. For each message received I wish to then execute some code.

I have tried recv, gets, and readpartial all with no luck.

I tried something like this:

loop {
  data = socket.recv( 100 )
  puts "Line received"
  puts data
}

What I see when sending messages from the server is that the first
message is received and printed, then the program hangs for 15 secs,
then the loop starts but each time the data is empty.

I am obviously doing something really stupid but I've spend hours now on
this so if someone could hint at how to do this I would be most
grateful.

Thanks,

Chris
-- 
Posted via http://www.ruby-forum.com/.