From: SEKI Masatoshi Date: 2013-06-05T22:45:08+09:00 Subject: Re: TCPServer/Socket and Marshal problem On 2013/06/05, at 17:54, Panagiotis Atmatzidis wrote: > Hello Robert, > > On 5 Ιουν 2013, at 08:52 , Robert Klemme wrote: > >> >> >> >> On Mon, Jun 3, 2013 at 8:47 PM, Panagiotis Atmatzidis wrote: >> 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. >> >> This is where I'd stop and use DRb instead. > > My first approach was a Sinatra app + YAML (that worked actually although I didn't like it very much though, so I drop it). > > Second approach was DRuby, but you can't have bi-directional communication in DRuby without turning the client into a server, which requires opening another port and this in a real-case scenario won't cut it for me. > > TCPServer/Socket seems a lot cleaner + I have the chance of learning one thing or two about how a client/server app works at this level. Since time is not an issue and learning as much as possible on the process is one of the goals, all I need to do (in my case) is ti implement 'MuTex' and handle TCPServer/Socket connection errors in a graceful way and I'm on. I recommend that you read the dRuby of the first version. I paste to the gist. https://gist.github.com/seki/5713863