require 'socket' require 'queens' PORT = 4321 HOST = "localhost" server = TCPServer.open(PORT) sock = server.accept q = Queens.new q.run { |qpos| sock.gets sock.qpos } sock.close server.close