From: Joe Van Dyk Date: 2005-07-01T06:07:42+09:00 Subject: Re: stupid TCP On 6/30/05, Joe Van Dyk wrote: > require 'socket' > > tcp_server = TCPServer.new 'localhost', 4321 > > puts "connecting..." > tcp_client = TCPSocket.new 'localhost', 4321 > tcp_client.write "Hello World" > puts "finshed writing" > > session = tcp_server.accept > puts "we recieved: <#{session.gets}>" > > > > Why doesn't that work? 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?