class Proxy::RemoteExecution::Cockpit::BufferedSocket

A wrapper class around different kind of sockets to comply with Net::SSH event loop

Public Class Methods

applies_for?(socket) click to toggle source
# File lib/smart_proxy_remote_execution_ssh/cockpit.rb, line 28
def self.applies_for?(socket)
  raise NotImplementedError
end
build(socket) click to toggle source
# File lib/smart_proxy_remote_execution_ssh/cockpit.rb, line 32
def self.build(socket)
  klass = [OpenSSLBufferedSocket, MiniSSLBufferedSocket, 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
new(socket) click to toggle source
# File lib/smart_proxy_remote_execution_ssh/cockpit.rb, line 15
def initialize(socket)
  @socket = socket
  initialize_buffered_io
end

Public Instance Methods

recv() click to toggle source
# File lib/smart_proxy_remote_execution_ssh/cockpit.rb, line 20
def recv
  raise NotImplementedError
end
send() click to toggle source
# File lib/smart_proxy_remote_execution_ssh/cockpit.rb, line 24
def send
  raise NotImplementedError
end