module PryRemoteEm::Client::Generic
Public Class Methods
new(opts = {})
click to toggle source
# File lib/pry-remote-em/client/generic.rb, line 9 def initialize(opts = {}) @opts = opts end
Public Instance Methods
connection_completed()
click to toggle source
# File lib/pry-remote-em/client/generic.rb, line 34 def connection_completed if get_peername port, ip = Socket.unpack_sockaddr_in(get_peername) log.info("[pry-remote-em] client connected to pryem://#{ip}:#{port}/") else # TODO use the args used to create this connection log.info('[pry-remote-em] client connected') end timeout = ENV['PRYEMNEGOTIMEOUT'].nil? || ENV['PRYEMNEGOTIMEOUT'].empty? ? NEGOTIATION_TIMEOUT : ENV['PRYEMNEGOTIMEOUT'] @nego_timer = EM::Timer.new(timeout) do fail("[pry-remote-em] server didn't finish negotiation within #{timeout} seconds; terminating") end end
log()
click to toggle source
# File lib/pry-remote-em/client/generic.rb, line 17 def log @log ||= Class.new do def print(str); $stderr.puts(str) end alias :info :print alias :warn :print alias :error :print alias :debug :print end.new end
opts()
click to toggle source
# File lib/pry-remote-em/client/generic.rb, line 13 def opts @opts ||= {} end
print(str)
click to toggle source
# File lib/pry-remote-em/client/generic.rb, line 19 def print(str); $stderr.puts(str) end
start_tls()
click to toggle source
Calls superclass method
# File lib/pry-remote-em/client/generic.rb, line 27 def start_tls return if @tls_started @tls_started = true log.info('[pry-remote-em] negotiating TLS') super(opts[:tls].is_a?(Hash) ? opts[:tls] : {}) end