#!/usr/bin/env ruby # $Id: echo_server1.rb,v 1.1 2002/06/05 15:48:59 radek Exp $ require 'socket' server = TCPServer.new 'localhost', 12345 while client = server.accept Thread.new(client) {|c| until c.eof? s = c.gets c.puts s end } end