GServer : Server by gserver « Network « Ruby






GServer


require 'gserver'

class HelloServer < GServer
  def serve(io)
    io.puts("Hello!")
  end
end

server = HelloServer.new(1234)
server.start
server.join

 








Related examples in the same category

1.Set a maximum number of allowed connections by supplying more parameters to new
2.create multiple servers
3.manage currently running servers by using several methods GServer makes available to start, stop, and check servers