From: Joe Van Dyk Date: 2005-07-01T06:24:08+09:00 Subject: Re: stupid TCP On 6/30/05, Ryan Leavengood wrote: > Joe Van Dyk said: > > Or, a threaded version: > > > > require 'socket' > > > > t = Thread.new do > > tcp_server = TCPServer.new 'localhost', 4321 > > while (session = tcp_server.accept) > > puts "we recieved: <#{session.gets}>" > > end > > end > > > > tcp_client = TCPSocket.new 'localhost', 4321 > > tcp_client.write "Hello World" > > > > t.join > > > > Still doesn't work though. :( What am I missing? > > You are missing a newline: > > tcp_client.write "Hello World\n" > > gets looks for a newline. > > Ryan Ahhh... thanks. All working fine now.