Sha256: e88bc7e453ce08dfe2b86a5b1509ea454875fd776ca3c636968f1179ea48ae3f

Contents?: true

Size: 461 Bytes

Versions: 2

Compression:

Stored size: 461 Bytes

Contents

module ApnServer
  module Protocol
    
    def post_init
      @address = Socket.unpack_sockaddr_in(self.get_peername)
      puts "[#{address.last}:#{address.first}] CONNECT"
    end
    
    def unbind
      puts "[#{address.last}:#{address.first}] DISCONNECT"    
    end
    
    def receive_data(data)
      (@buf ||= "") << data
      if notification = ApnServer::Notification.valid?(@buf)
        queue.push(notification)
      end
    end
    
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
bpoweski-apnserver-0.0.15 lib/apnserver/protocol.rb
bpoweski-apnserver-0.0.17 lib/apnserver/protocol.rb