A wrapper class around different kind of sockets to comply with Net::SSH event loop
# File lib/smart_proxy_remote_execution_ssh/cockpit.rb, line 27 def self.applies_for?(socket) raise NotImplementedError end
# File lib/smart_proxy_remote_execution_ssh/cockpit.rb, line 31 def self.build(socket) klass = [OpenSSLBufferedSocket, StandardBufferedSocket].find do |potential_class| potential_class.applies_for?(socket) end raise "No suitable implementation of buffered socket available for #{socket.inspect}" unless klass klass.new(socket) end
# File lib/smart_proxy_remote_execution_ssh/cockpit.rb, line 14 def initialize(socket) @socket = socket initialize_buffered_io end
# File lib/smart_proxy_remote_execution_ssh/cockpit.rb, line 19 def recv raise NotImplementedError end
# File lib/smart_proxy_remote_execution_ssh/cockpit.rb, line 23 def send raise NotImplementedError end