class GQTP::Backend::Synchronous::Server

Attributes

host[RW]
port[RW]

Public Class Methods

new(options={}) click to toggle source
# File lib/gqtp/backend/synchronous.rb, line 88
def initialize(options={})
  @options = options
  @host = options[:host] || "0.0.0.0"
  @port = options[:port] || 10043
  @backlog = options[:backlog] || 128
end

Public Instance Methods

run() { |io| ... } click to toggle source
# File lib/gqtp/backend/synchronous.rb, line 95
def run
  @server = TCPServer.new(@host, @port)
  @server.listen(@backlog)
  loop do
    client = @server.accept
    yield(IO.new(client))
  end
  Request.new(nil)
end
shutdown() click to toggle source
# File lib/gqtp/backend/synchronous.rb, line 105
def shutdown
  @server.shutdown
end