line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Net::APNs::Extended::Feedback; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
49869
|
use strict; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
64
|
|
4
|
2
|
|
|
2
|
|
8
|
use warnings; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
46
|
|
5
|
2
|
|
|
2
|
|
815
|
use parent 'Net::APNs::Extended::Base'; |
|
2
|
|
|
|
|
498
|
|
|
2
|
|
|
|
|
9
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
my %default = ( |
8
|
|
|
|
|
|
|
host_production => 'feedback.push.apple.com', |
9
|
|
|
|
|
|
|
host_sandbox => 'feedback.sandbox.push.apple.com', |
10
|
|
|
|
|
|
|
is_sandbox => 0, |
11
|
|
|
|
|
|
|
port => 2196, |
12
|
|
|
|
|
|
|
); |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub new { |
15
|
2
|
|
|
2
|
1
|
852
|
my ($class, %args) = @_; |
16
|
2
|
|
|
|
|
25
|
$class->SUPER::new(%default, %args); |
17
|
|
|
|
|
|
|
} |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub retrieve_feedback { |
20
|
1
|
|
|
1
|
1
|
631
|
my $self = shift; |
21
|
1
|
|
|
|
|
4
|
my $data = $self->_read; |
22
|
|
|
|
|
|
|
|
23
|
1
|
|
|
|
|
32
|
my $res = []; |
24
|
1
|
|
|
|
|
4
|
while ($data) { |
25
|
2
|
|
|
|
|
2
|
my ($time_t, $token_bin); |
26
|
2
|
|
|
|
|
8
|
($time_t, $token_bin, $data) = unpack 'N n/a a*', $data; |
27
|
2
|
|
|
|
|
11
|
push @$res, { |
28
|
|
|
|
|
|
|
time_t => $time_t, |
29
|
|
|
|
|
|
|
token_bin => $token_bin, |
30
|
|
|
|
|
|
|
token_hex => unpack 'H*', $token_bin, |
31
|
|
|
|
|
|
|
}; |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
1
|
|
|
|
|
3
|
return $res; |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
1; |
38
|
|
|
|
|
|
|
__END__ |