Sha256: b24b78c36a654045b0de6bcc3a7fc89a1bc03caf575cdf39f828ff787e011ad4

Contents?: true

Size: 730 Bytes

Versions: 2

Compression:

Stored size: 730 Bytes

Contents

module ApnServer
  module Protocol
    def post_init
      @address = Socket.unpack_sockaddr_in(self.get_peername)
      Config.logger.debug "#{Time.now} [#{address.last}:#{address.first}] CONNECT"
    end

    def unbind
      Config.logger.debug "#{Time.now} [#{address.last}:#{address.first}] DISCONNECT"
    end

    def receive_data(data)
      (@buf ||= "") << data
      if notification = ApnServer::Notification.valid?(@buf)
        Config.logger.debug "#{Time.now} [#{address.last}:#{address.first}] found valid Notification: #{notification}"
        queue.push(notification)
      else
        Config.logger.debug "#{Time.now} [#{address.last}:#{address.first}] invalid notification: #{@buf}"
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
apnserver-0.2.2 lib/apnserver/protocol.rb
apnserver-0.2.1 lib/apnserver/protocol.rb