Module: EventMachine::Wssh::Ephemeral::Parent

Defined in:
lib/em/wssh/ephemeral.rb

Instance Method Summary collapse

Instance Method Details

#initialize(port) ⇒ Object



74
75
76
77
78
# File 'lib/em/wssh/ephemeral.rb', line 74

def initialize port
  @port=port
  @c=EM::Wssh::Connect
  log "Listening to port", port
end

#log(*args) ⇒ Object



80
81
82
# File 'lib/em/wssh/ephemeral.rb', line 80

def log *args
  @c.log *args
end

#post_initObject



84
85
86
87
# File 'lib/em/wssh/ephemeral.rb', line 84

def post_init
  log "Connected to parent"
  send_data "#{@port}\n"
end

#unbindObject



89
90
91
92
# File 'lib/em/wssh/ephemeral.rb', line 89

def unbind
  log "Parent disconnected"
  EM.stop_event_loop
end