Class: Blather::FileTransfer::S5b::SocketConnection

Inherits:
EM::P::Socks5
  • Object
show all
Includes:
EM::Deferrable
Defined in:
lib/blather/file_transfer/s5b.rb

Instance Method Summary collapse

Constructor Details

#initialize(host, port, handler, *params) ⇒ SocketConnection

Returns a new instance of SocketConnection.



92
93
94
95
96
# File 'lib/blather/file_transfer/s5b.rb', line 92

def initialize(host, port, handler, *params)
  super(host, port)
  @@handler = handler
  @params = params
end

Instance Method Details

#post_initObject



98
99
100
101
102
103
104
105
106
# File 'lib/blather/file_transfer/s5b.rb', line 98

def post_init
  self.succeed

  class << self
    include @@handler
  end
  send(:initialize, *@params)
  post_init
end

#unbindObject



108
109
110
# File 'lib/blather/file_transfer/s5b.rb', line 108

def unbind
  self.fail if @socks_state != :connected
end