From: Joel VanderWerf Date: 2013-06-04T04:24:47+09:00 Subject: Re: TCPServer/Socket and Marshal problem On 06/03/2013 11:47 AM, Panagiotis Atmatzidis wrote: > Hello, > > I'm writing a client/server application using TCPSocket and TCPServer. To serialize the objects at this point I use Marshal, since it comes handy. ... > What I notice is that connection ends when the '\n' character appears. I think that the issue is me using "@con.gets" method instead of something more appropriate. I tried @con.read but since 'read' method waits for the remote party to send an 'EOF' or close the connection stalls. > > Is there any other method I can use instead of gets? I did a 'methods.sort' but I can't see and I don't know how to read about these methods using "ri". 'ri TCPSocket::getc' for example doesn't work. You can try Marshal.load(conn) on the client side. The Marshal#load method determines just how many bytes to read.