# -*- coding: utf-8 -*- require 'socket' require 'queens' PORT = 4321 HOST = "localhost" server = TCPServer.open(PORT) sock = server.accept q = Queens.new q.run { |qpos| sock.gets sock.puts qpos } sock.close server.close