From: Edgardo Hames Date: 2004-11-09T08:13:03+09:00 Subject: Re: Socket problem On Tue, 9 Nov 2004 05:23:34 +0900, Ben Armstrong wrote: > On Sat, 06 Nov 2004 21:32:19 +0900, ts wrote: > > > > >>>>>> "B" == Ben Armstrong writes: > > > > B> We're having problems with the standard Socket module with Ruby. > > > > Try to use IO#sync= > > That didn't help. Besides, sync is set to true by default. > > However, I did pull out a packet sniffer and found out something very > interesting. It appears that for each operation, the old contents of the > buffer is not being overwritten! Instead, it just keeps getting appended > to. > > Thus, when I send the first line, I am sending "test\r\n". The server > receives this, and writes back "test\r\n\TEST\r\n". Since my client only > does a gets on the one line expected, it displays "test\r\n". > Hi Ben. I might be completely wrong with this one, but have you tried removing the "\r\n" at the end of the messages? Doesn't #puts add the newline for you. I believe that could be it. Regards, Ed -- Despite the surge of power you feel upon learning Ruby, resist the urge to trip others or slap them in the bald head. DO NOT LORD YOUR RUBYNESS OVER OTHERS!