Class: TcpServer::Server
- Inherits:
-
Object
- Object
- TcpServer::Server
- Includes:
- InstanceMethods
- Defined in:
- lib/tcp_server/server.rb
Overview
The Server class sets up the netty server.
Constant Summary collapse
- CHANNEL_TYPE =
NioServerSocketChannel.java_class
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
-
#initialize(options = {}, *handlers, &block) ⇒ Server
constructor
A new instance of Server.
Methods included from InstanceMethods
#<<, #add_listener, #backlog_option, #bootstrap, #boss_group, #channel_group, #channel_type, #channelizer, #configure_handlers, #handle_interrupt, #keep_alive, #keep_alive_option, #logging_handler, #max_queued_incoming_connections, #port, #quietly, #replace_listeners, #run, #server_channel, #shutdown, #stop, #worker_group
Methods included from DefaultHandler
#channel_active, #exception_caught, #message_received
Constructor Details
#initialize(options = {}, *handlers, &block) ⇒ Server
Returns a new instance of Server.
33 34 35 36 37 38 39 40 |
# File 'lib/tcp_server/server.rb', line 33 def initialize( = {}, *handlers, &block) raise ArgumentError, 'Parameter may not be nil: options' if .nil? @options = TcpServer.server_config.merge() configure_handlers(*(handlers.empty? && block.nil? ? [self] : handlers), &block) ensure listeners = channelizer.default_handler.listeners log.trace "##{__method__} listeners: #{listeners}" end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
31 32 33 |
# File 'lib/tcp_server/server.rb', line 31 def @options end |