line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# $Id: Syslog.pm 446 2004-12-27 00:57:57Z sungo $ |
2
|
|
|
|
|
|
|
package POE::Component::Server::Syslog; |
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
# Docs at the end. |
5
|
|
|
|
|
|
|
|
6
|
3
|
|
|
3
|
|
448913
|
use 5.006001; |
|
3
|
|
|
|
|
12
|
|
|
3
|
|
|
|
|
108
|
|
7
|
3
|
|
|
3
|
|
17
|
use warnings; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
96
|
|
8
|
3
|
|
|
3
|
|
19
|
use strict; |
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
95
|
|
9
|
|
|
|
|
|
|
|
10
|
3
|
|
|
3
|
|
13
|
use POE; |
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
26
|
|
11
|
3
|
|
|
3
|
|
3070
|
use POE::Component::Server::Syslog::TCP; |
|
3
|
|
|
|
|
11
|
|
|
3
|
|
|
|
|
108
|
|
12
|
3
|
|
|
3
|
|
2565
|
use POE::Component::Server::Syslog::UDP; |
|
3
|
|
|
|
|
10
|
|
|
3
|
|
|
|
|
631
|
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
our $VERSION = '1.20'; |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
sub spawn { |
17
|
2
|
|
|
2
|
1
|
951
|
my $class = shift; |
18
|
2
|
|
|
|
|
13
|
my %args = @_; |
19
|
2
|
|
|
|
|
7
|
my $type = delete $args{Type}; |
20
|
|
|
|
|
|
|
|
21
|
2
|
|
|
|
|
5
|
my $s; |
22
|
2
|
50
|
|
|
|
11
|
if($type) { |
23
|
2
|
100
|
|
|
|
10
|
if($type eq 'tcp') { |
|
|
50
|
|
|
|
|
|
24
|
1
|
|
|
|
|
13
|
$s = POE::Component::Server::Syslog::TCP->spawn( |
25
|
|
|
|
|
|
|
%args, |
26
|
|
|
|
|
|
|
); |
27
|
|
|
|
|
|
|
} elsif ($type eq 'udp') { |
28
|
1
|
|
|
|
|
12
|
$s = POE::Component::Server::Syslog::UDP->spawn( |
29
|
|
|
|
|
|
|
%args, |
30
|
|
|
|
|
|
|
); |
31
|
|
|
|
|
|
|
} else { |
32
|
0
|
|
|
|
|
0
|
return undef; |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
} else { |
35
|
0
|
|
|
|
|
0
|
$s = POE::Component::Server::Syslog::UDP->spawn( |
36
|
|
|
|
|
|
|
%args, |
37
|
|
|
|
|
|
|
); |
38
|
|
|
|
|
|
|
} |
39
|
2
|
|
|
|
|
13
|
return $s; |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
1; |
43
|
|
|
|
|
|
|
__END__ |