Sha256: 3182ba860ae0f326faa39496f163ae69a0c3c7fb80d0ad27101327468565277f

Contents?: true

Size: 886 Bytes

Versions: 1

Compression:

Stored size: 886 Bytes

Contents

# code:
# * George Moschovitis  <gm@navel.gr>
#
# (c) 2004 Navel, all rights reserved.
# $Id: server.rb 109 2004-10-27 09:12:45Z gmosx $

require "n/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

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
nitro-0.3.0 lib/n/server.rb