Class: EM::APNS::Connection
- Inherits:
-
Connection
- Object
- Connection
- EM::APNS::Connection
- Defined in:
- lib/em-apns/connection.rb
Instance Attribute Summary collapse
-
#num ⇒ Object
Returns the value of attribute num.
Instance Method Summary collapse
- #connection_completed ⇒ Object
- #on_unbind(&block) ⇒ Object
- #post_init ⇒ Object
- #receive_data(data) ⇒ Object
- #unbind ⇒ Object
Instance Attribute Details
permalink #num ⇒ Object
Returns the value of attribute num.
3 4 5 |
# File 'lib/em-apns/connection.rb', line 3 def num @num end |
Instance Method Details
permalink #connection_completed ⇒ Object
[View source]
13 14 15 |
# File 'lib/em-apns/connection.rb', line 13 def connection_completed EM::APNS.logger.info("Connection established") end |
permalink #on_unbind(&block) ⇒ Object
[View source]
28 29 30 |
# File 'lib/em-apns/connection.rb', line 28 def on_unbind &block @unbind = block end |
permalink #post_init ⇒ Object
[View source]
5 6 7 8 9 10 11 |
# File 'lib/em-apns/connection.rb', line 5 def post_init start_tls( :private_key_file => EM::APNS.key, :cert_chain_file => EM::APNS.cert, :verify_peer => false ) end |
permalink #receive_data(data) ⇒ Object
[View source]
17 18 19 20 21 |
# File 'lib/em-apns/connection.rb', line 17 def receive_data(data) data_array = data.unpack("ccN") error_response = Error.new(*data_array) EM::APNS.logger.info("#{error_response}") end |
permalink #unbind ⇒ Object
[View source]
23 24 25 26 |
# File 'lib/em-apns/connection.rb', line 23 def unbind EM::APNS.logger.info("Connection terminated") @unbind.call(self) if @unbind end |