From: Massimiliano Mirra Date: 2001-12-28T12:09:41+09:00 Subject: [ruby-talk:29509] Re: TCP Sockets with Ruby 1.6.5 (2001-09-19) [i386-cygwin] On Fri, Dec 28, 2001 at 10:01:03AM +0900, Paul Wanadoo NL wrote: > >> s =TCPSocket.new("192.168.0.178",13) > >> data = s.recv(150) > >> puts data // check I I get the initial response string > >> from server ok > >> s.send("/showcommands",0) > >> data = s.recv(3050) > thanks, of course I forgot the CR LF on the end (doh!). Much appreciated \n is just a LF, \r is a CR. So, if you need a CR LF you need to end with \r\n. If the dialog is based entirely on LF terminated strings (as it appears to be), you might want to make it revolve around the puts and gets methods that are available from sockets, too: s = TCPSocket.new("192.168.0.178", 13) data = s.gets s.puts "/shocommands" data = s.gets Massimiliano