Class: HrrRbSsh::Server

Inherits:
Object
  • Object
show all
Includes:
Loggable
Defined in:
lib/hrr_rb_ssh/server.rb

Instance Attribute Summary

Attributes included from Loggable

#log_key, #logger

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Loggable

#log_debug, #log_error, #log_fatal, #log_info, #log_warn

Constructor Details

#initialize(options = {}, logger: nil) ⇒ Server

Returns a new instance of Server.



18
19
20
21
# File 'lib/hrr_rb_ssh/server.rb', line 18

def initialize options={}, logger: nil
  self.logger = logger
  @options = options
end

Class Method Details

.start(io, options = {}, logger: nil) ⇒ Object



13
14
15
16
# File 'lib/hrr_rb_ssh/server.rb', line 13

def self.start io, options={}, logger: nil
  server = self.new options, logger: logger
  server.start io
end

Instance Method Details

#start(io) ⇒ Object



23
24
25
26
27
28
29
# File 'lib/hrr_rb_ssh/server.rb', line 23

def start io
  log_info { "start server service" }
  transport      = Transport.new      io, Mode::SERVER, @options, logger: logger
  authentication = Authentication.new transport, Mode::SERVER, @options, logger: logger
  connection     = Connection.new     authentication, Mode::SERVER, @options, logger: logger
  connection.start
end