# list0805.rb
# サーバにメッセージを送り、返答を表示するクライアント
require 'socket'
hostname = Socket::gethostname
port = 3456
cs = TCPSocket.open(hostname,port)
while !$stdin.eof? do
cs.puts $stdin.gets.chomp # サーバへキー入力の内容を送る
puts cs.gets.chomp # サーバからの返事を待つ
end