Hi,

In message "[ruby-talk:13848] Sockets-- using readlines versus gets"
    on 01/04/19, "Norman Makoto Su" <makoto / uclink4.berkeley.edu> writes:

|sock = TCPSocket.new(...)
|sock.send("blah\nblah\n\C-D")
|
|Then, on the server side I have
|
|server = TCPServer.new(...)
|sock = server.accept
|recv_msg = sock.readlines
|print recv_msg
|
|But that doesn't work.  It just sits there waiting.

readlines read everything until the end of file.  In this case, client
side does not close the socket, so that server side waits forever.
Use read, gets or readline.
							matz.