Sha256: b696d633ffc0ab5b62eadd9514f4130c74d88f16c396a8b8b762b94805fa885d
Contents?: true
Size: 857 Bytes
Versions: 1
Compression:
Stored size: 857 Bytes
Contents
# = Server # # Generic server infrastructure # # code:: gmosx # # (c) 2004 Navel, all rights reserved. # $Id: server.rb 71 2004-10-18 10:50:22Z gmosx $ require "n/application" module N # = Server # # Base server class # 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
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
nitro-0.1.2 | lib/n/server.rb |