Module: Tkellem::PushServiceConnection

Includes:
EasyLogger
Defined in:
lib/tkellem/plugins/push_service.rb

Instance Method Summary collapse

Methods included from EasyLogger

#failsafe, logger, logger=, trace, #trace, trace=

Instance Method Details

#initialize(service, server, port) ⇒ Object



127
128
129
130
131
# File 'lib/tkellem/plugins/push_service.rb', line 127

def initialize(service, server, port)
  @service = service
  @server = server
  @port = port
end

#log_nameObject



137
138
139
# File 'lib/tkellem/plugins/push_service.rb', line 137

def log_name
  "#{@server}:#{@port}"
end

#post_initObject



133
134
135
# File 'lib/tkellem/plugins/push_service.rb', line 133

def post_init
  start_tls :verify_peer => false
end

#ssl_handshake_completedObject



141
142
143
144
# File 'lib/tkellem/plugins/push_service.rb', line 141

def ssl_handshake_completed
  debug "connected to push service #{@server}:#{@port}"
  @connected = true
end

#unbindObject



146
147
148
149
150
# File 'lib/tkellem/plugins/push_service.rb', line 146

def unbind
  debug "lost connection to push service #{@server}:#{@port}"
  @connected = false
  @service.lost_connection
end