Ruby GServer 设置允许客户端的同时连接数 2015/03/18 14485 require 'gserver' class HelloServer < GServer def serve(io) io.puts("Say something to me:") line = io.gets io.puts("You said '#{line.chomp}'") end end server = HelloServer.new(1234, '127.0.0.1', 1) server.start server.join