# code: # * George Moschovitis # # (c) 2004 Navel, all rights reserved. # $Id: server.rb 155 2004-11-13 20:32:12Z gmosx $ require "nitro/application" module N # = Server # # Base server class, provides generic server # infrastructure. # class Server < N::Application # the listening address/port for this server. attr_reader :address, :port def initialize(name = "Server") super end # Start the server # def start super end # Stop the server # def stop super end # The main server loop # def run begin while :RUNNING == @status if live = IO.select(@ios, nil, nil, 2.0) end end rescue end end # Override this method in your custom server. This method is very # flexible, you can spawn threads, use keep alive connections, # handle+close, use handler pools, anything. # def handle end end end # module