box-o-sand/ruby-sockets/marco-polo/client.rb

12 lines
210 B
Ruby

require 'socket'
loop do
TCPSocket.open('127.0.0.1', 22000) do |sock|
sock.send("sally #{rand(100)} #{rand(100)}\n", 0)
sock.recv(100)
sock.close
STDOUT.write('.')
STDOUT.flush
end
end