line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package HTTP::Server::Simple::Bonjour; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
5
|
use strict; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
34
|
|
4
|
1
|
|
|
1
|
|
12
|
use 5.8.1; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
58
|
|
5
|
|
|
|
|
|
|
our $VERSION = '0.02'; |
6
|
|
|
|
|
|
|
|
7
|
1
|
|
|
1
|
|
5
|
use Carp; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
89
|
|
8
|
1
|
|
|
1
|
|
2001
|
use NEXT; |
|
1
|
|
|
|
|
5000
|
|
|
1
|
|
|
|
|
207
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
my $publisher = eval { |
11
|
|
|
|
|
|
|
require Net::Rendezvous::Publish; |
12
|
|
|
|
|
|
|
Net::Rendezvous::Publish->new; |
13
|
|
|
|
|
|
|
}; |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
sub print_banner { |
16
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
17
|
|
|
|
|
|
|
|
18
|
0
|
0
|
|
|
|
|
unless ($publisher) { |
19
|
0
|
|
|
|
|
|
carp "Publisher backend is not available. Install one of Net::Rendezvous::Publish::Backend modules from CPAN."; |
20
|
0
|
|
|
|
|
|
$self->NEXT::print_banner; |
21
|
0
|
|
|
|
|
|
return; |
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
$publisher->publish( |
25
|
0
|
|
|
|
|
|
name => $self->service_name, |
26
|
|
|
|
|
|
|
type => $self->service_type, |
27
|
|
|
|
|
|
|
port => $self->port, |
28
|
|
|
|
|
|
|
domain => 'local', |
29
|
|
|
|
|
|
|
); |
30
|
|
|
|
|
|
|
|
31
|
0
|
|
|
|
|
|
$self->NEXT::print_banner; |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
sub service_name { |
35
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
36
|
0
|
|
|
|
|
|
require Sys::Hostname; |
37
|
0
|
|
|
|
|
|
return Sys::Hostname::hostname(); |
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
|
41
|
0
|
|
|
0
|
1
|
|
sub service_type { '_http._tcp' } |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
1; |
45
|
|
|
|
|
|
|
__END__ |