require "socket" sock = TCPSocket.open("localhost", 10025) puts 'SEND "helo"' sock.puts "helo" puts 'RECEIVE ' + sock.gets puts 'SEND "quit"' sock.puts "quit" puts 'RECEIVE ' + sock.gets sock.close