line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Net::APNs::Extended::Feedback; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
154836
|
use strict; |
|
2
|
|
|
|
|
16
|
|
|
2
|
|
|
|
|
55
|
|
4
|
2
|
|
|
2
|
|
10
|
use warnings; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
60
|
|
5
|
2
|
|
|
2
|
|
854
|
use parent 'Net::APNs::Extended::Base'; |
|
2
|
|
|
|
|
645
|
|
|
2
|
|
|
|
|
10
|
|
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
|
1261
|
my ($class, %args) = @_; |
16
|
2
|
|
|
|
|
37
|
$class->SUPER::new(%default, %args); |
17
|
|
|
|
|
|
|
} |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub retrieve_feedback { |
20
|
1
|
|
|
1
|
1
|
1141
|
my $self = shift; |
21
|
1
|
|
|
|
|
4
|
my $data = $self->_read; |
22
|
|
|
|
|
|
|
|
23
|
1
|
|
|
|
|
51
|
my $res = []; |
24
|
1
|
|
|
|
|
4
|
while ($data) { |
25
|
2
|
|
|
|
|
5
|
my ($time_t, $token_bin); |
26
|
2
|
|
|
|
|
10
|
($time_t, $token_bin, $data) = unpack 'N n/a a*', $data; |
27
|
2
|
|
|
|
|
21
|
push @$res, { |
28
|
|
|
|
|
|
|
time_t => $time_t, |
29
|
|
|
|
|
|
|
token_bin => $token_bin, |
30
|
|
|
|
|
|
|
token_hex => unpack 'H*', $token_bin, |
31
|
|
|
|
|
|
|
}; |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
1
|
|
|
|
|
4
|
return $res; |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
1; |
38
|
|
|
|
|
|
|
__END__ |