line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package LCC::UNS; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
# Make sure we do everything by the book |
4
|
|
|
|
|
|
|
# Set modules to inherit from |
5
|
|
|
|
|
|
|
# Set version information |
6
|
|
|
|
|
|
|
|
7
|
1
|
|
|
1
|
|
5
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
140
|
|
8
|
|
|
|
|
|
|
@LCC::UNS::ISA = qw(LCC); |
9
|
|
|
|
|
|
|
$LCC::UNS::VERSION = '0.02'; |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
# Return true value for use |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
1; |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
#------------------------------------------------------------------------ |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
# The following methods are class methods |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
#------------------------------------------------------------------------ |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
# IN: 1 LCC object |
22
|
|
|
|
|
|
|
# 2 server:port specification |
23
|
|
|
|
|
|
|
# 3 ref to hash with method/value pairs |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
sub _new { |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
# Obtain the class of the object |
28
|
|
|
|
|
|
|
# Attempt to create the base object |
29
|
|
|
|
|
|
|
# Handle the serverport specification if there is any |
30
|
|
|
|
|
|
|
# Handle any method calls |
31
|
|
|
|
|
|
|
|
32
|
0
|
|
|
0
|
|
|
my $class = shift; |
33
|
0
|
|
|
|
|
|
my $self = $class->SUPER::_new( shift ); |
34
|
0
|
0
|
0
|
|
|
|
$self->serverport( shift ) if @_ and !ref($_[0]); |
35
|
0
|
0
|
|
|
|
|
$self->Set( shift ) if ref($_[0]); |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
# Return the object |
38
|
|
|
|
|
|
|
|
39
|
0
|
|
|
|
|
|
return $self; |
40
|
|
|
|
|
|
|
} #_new |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
#------------------------------------------------------------------------ |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
# The following methods change the object |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
#------------------------------------------------------------------------ |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
# IN: new server:port specification |
49
|
|
|
|
|
|
|
# OUT: current/old server:port specification |
50
|
|
|
|
|
|
|
|
51
|
0
|
|
|
0
|
0
|
|
sub serverport { shift->_class_variable( 'serverport',@_ ) } #serverport |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
#------------------------------------------------------------------------ |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
# The following subroutines deal with standard Perl features |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
#------------------------------------------------------------------------ |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
sub DESTROY { |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
# Obtain the object |
62
|
|
|
|
|
|
|
# Stop the daemon if so specified |
63
|
|
|
|
|
|
|
|
64
|
0
|
|
|
0
|
|
|
my $self = shift; |
65
|
0
|
0
|
|
|
|
|
$self->stop if $self->auto_shutdown; |
66
|
|
|
|
|
|
|
} #DESTROY |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
#------------------------------------------------------------------------ |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
__END__ |