Class: Telnet::Server

Inherits:
Server::Server
  • Object
show all
Includes:
InstanceMethods
Defined in:
lib/telnet/server.rb

Overview

The Server class sets up the netty server

Instance Method Summary collapse

Methods included from InstanceMethods

#channel_active, #channel_read_complete, #close, #exception_caught, #handle_empty_request, #handle_message, #message_received, #quit_command?

Constructor Details

#initialize(options = {}, *handlers, &block) ⇒ Server

Returns a new instance of Server.

Raises:

  • (ArgumentError)


25
26
27
28
# File 'lib/telnet/server.rb', line 25

def initialize(options = {}, *handlers, &block)
  raise ArgumentError, 'Parameter may not be nil: options' if options.nil?
  super(::Telnet.server_config.merge(options), *handlers, &block)
end

Instance Method Details

#bootstrapObject



30
31
32
33
# File 'lib/telnet/server.rb', line 30

def bootstrap
  super
  @bootstrap.childOption(Java::io.netty.channel.ChannelOption::SO_KEEPALIVE, true)
end