Sha256: fe2a6f937c3e2816a7190560bbe02c2333626ae840ac452dd58504663ad53731

Contents?: true

Size: 485 Bytes

Versions: 10

Compression:

Stored size: 485 Bytes

Contents

module ApnServer
  module Protocol
    
    def post_init
      @address = Socket.unpack_sockaddr_in(self.get_peername)
      puts "#{Time.now} [#{address.last}:#{address.first}] CONNECT"
    end
    
    def unbind
      puts "#{Time.now} [#{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

10 entries across 10 versions & 1 rubygems

Version Path
bpoweski-apnserver-0.0.10 lib/apnserver/protocol.rb
bpoweski-apnserver-0.0.12 lib/apnserver/protocol.rb
bpoweski-apnserver-0.0.6 lib/apnserver/protocol.rb
bpoweski-apnserver-0.0.7 lib/apnserver/protocol.rb
bpoweski-apnserver-0.0.8 lib/apnserver/protocol.rb
bpoweski-apnserver-0.0.9 lib/apnserver/protocol.rb
bpoweski-apnserver-0.1.2 lib/apnserver/protocol.rb
bpoweski-apnserver-0.1.3 lib/apnserver/protocol.rb
bpoweski-apnserver-0.1.6 lib/apnserver/protocol.rb
bpoweski-apnserver-0.1.7 lib/apnserver/protocol.rb