blib/lib/Net/UNIX/Server.pm

filter: Statementstmt 83.3% 40 / 48 Branchbran 61.1% 11 / 18 Conditioncond 53.3% 8 / 15 MC/DCmcdc 0.0% 0 / 8 Subroutinesub 76.9% 10 / 13 Podpod 60.0% 3 / 5 totaltotal 67.2% 72 / 107 CC 15 SCAR 18.9
CC
15
Cov
73%
new
12.3
init
7.8
carp
2.0
CRAP 6.6
« blib/lib/Net/UDP.pm ↑ Summary Gen.xs »
1 # Copyright 1997,2002 Spider Boardman.
2 # All rights reserved.
3 #
4 # Automatic licensing for this software is available. This software
5 # can be copied and used under the terms of the GNU Public License,
6 # version 1 or (at your option) any later version, or under the
7 # terms of the Artistic license. Both of these can be found with
8 # the Perl distribution, which this software is intended to augment.
9 #
10 # THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
11 # IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
12 # WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
13  
14 # rcsid: "@(#) $Id: Server.dat,v 1.16 2002/03/30 10:11:24 spider Exp $"
15  
16 package Net::UNIX::Server;
17 1 ▶use 5.004_04;
Subroutine BEGIN: called CC=1 SCAR=0.0
18  
19 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
20 #use Carp;
21 0 ▶sub carp { require Carp; goto &Carp::carp; }
Subroutine carp: not called CC=1 SCAR=6.9
Pod undocumented
22 0 ▶sub croak { require Carp; goto &Carp::croak; }
Subroutine croak: not called CC=1 SCAR=6.9
Pod undocumented
23 1 ▶use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
Subroutine BEGIN: called CC=1 SCAR=0.0
24  
25 1 ▶BEGIN {
Subroutine BEGIN: called CC=1 SCAR=0.4
26 1 $VERSION = '1.0';
27 0 ▶ eval "sub Version { __PACKAGE__ . ' v$VERSION' }";
Subroutine Version: not called CC=1 SCAR=1.2
Pod documented
28 }
29  
30 #use AutoLoader; # someday add back, along with AUTOLOAD, below
31 #use Exporter ();
32 1 ▶use Net::UNIX 1.0;
Subroutine BEGIN: called CC=1 SCAR=0.0
33 1 ▶use Net::Gen 1.0 qw(/^SOCK_/);
Subroutine BEGIN: called CC=1 SCAR=0.0
34  
35 1 ▶BEGIN {
Subroutine BEGIN: called CC=1 SCAR=0.0
36 1 @ISA = 'Net::UNIX';
37  
38 # Items to export into callers namespace by default.
39 # (Move infrequently used names to @EXPORT_OK below.)
40  
41 1 @EXPORT = qw(
42 );
43  
44 1 @EXPORT_OK = qw(
45 );
46  
47 1 %EXPORT_TAGS = (
48 ALL => [@EXPORT, @EXPORT_OK],
49 );
50 # *AUTOLOAD = \$Net::Gen::AUTOLOAD;
51 }
52  
53 # sub AUTOLOAD inherited from Net::Gen
54  
55 # since 5.003_96 will break simple subroutines with inherited autoload, cheat
56 #sub AUTOLOAD
57 #{
58 # #$Net::Gen::AUTOLOAD = $AUTOLOAD;
59 # goto &Net::Gen::AUTOLOAD;
60 #}
61  
62  
63 # Preloaded methods go here. Autoload methods go after __END__, and are
64 # processed by the autosplit program.
65  
66 # Can't autoload new & init when Net::Gen has them non-autoloaded. Feh.
67  
68 # No additional sockopts for UNIX-domain sockets (?)
69  
70 sub new
71 3 ▶{
Subroutine new: called CC=9 SCAR=25.1
Pod documented
72 1 ▶ use attrs qw(locked);
Subroutine BEGIN: called CC=1 SCAR=0.0
73 3 my $whoami = $_[0]->_trace(\@_,1);
74 3 my($class,@Args,$self) = @_;
75 3 $self = $class->SUPER::new(@Args);
76 3 ▶ $class = ref $class if ref $class;
Branch: 1 branch
BranchTrueFalseTotal
if ref $class 1 2 3
77 3 ▶ ($self || $class)->_trace(\@_,2," self" .
Branch: 1 branch
BranchTrueFalseTotal
defined $self ? : 3 0 3
Condition33%1/3
$self || $class
l!l&&r!l&&!r
300
MC/DC0%0/2
$self || $class
$self $class
Truth table33%1/3
A || B
A= $selfB= $class
ABresult
1X1
011
000
78 (defined $self ? "=$self" : " undefined") .
79 " after sub-new");
80 3 ▶ if ($self) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self) 3 0 3
81 3 $self->setparams({reuseaddr => 1}, -1);
82 3 ▶ if ($class eq __PACKAGE__) {
Branch: 1 branch
BranchTrueFalseTotal
if ($class eq __PACKAGE__) 3 0 3
83 3 ▶ unless ($self->init(@Args)) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($self->init(@Args)) 0 3 3
84 0 local $!; # preserve errno
85 0 undef $self; # against the side-effects of this
86 0 undef $self; # another statement needed for unwinding
87 }
88 }
89 }
90 3 ▶ ($self || $class)->_trace(0,1," returning " .
Branch: 1 branch
BranchTrueFalseTotal
defined $self ? : 3 0 3
Condition33%1/3
$self || $class
l!l&&r!l&&!r
300
MC/DC0%0/2
$self || $class
$self $class
Truth table33%1/3
A || B
A= $selfB= $class
ABresult
1X1
011
000
91 (defined $self ? "self=$self" : "undefined"));
92 3 $self;
93 }
94  
95 #& init($self [, $thispath][, \%params]) : {$self | undef}
96 sub init
97 3 ▶{
Subroutine init: called CC=7 SCAR=20.5
Pod documented
98 3 my ($self,@args) = @_;
99 3 ▶ return undef unless $self->_init('thispath',@args);
Branch: 1 branch
BranchTrueFalseTotal
unless $self->_init("thispath", @args) 0 3 3
100 3 ▶ if ($self->isbound) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->isbound) 2 1 3
101 return undef
102 2 ▶ unless $self->getparam('type') == SOCK_DGRAM or
Branch: 1 branch
BranchTrueFalseTotal
unless $self->getparam("type") == 2 or $self->isconnected or $self->didlisten or $self->listen 0 2 2
Condition66%6/9
$self->getparam("type") == 2 or $self->isconnected or $self->didlisten or $self->listen
l!l&&r!l&&!r
110
$self->getparam("type") == 2 or $self->isconnected or $self->didlisten
l!l&&r!l&&!r
101
$self->getparam("type") == 2 or $self->isconnected
l!l&&r!l&&!r
101
MC/DC0%0/4
$self->getparam("type") == 2 or $self->isconnected or $self->didlisten or $self->listen
$self->getparam("type") == 2 $self->isconnected $self->didlisten $self->listen
Truth table40%2/5
A or B or C or D
A= $self->getparam("type") == 2B= $self->isconnectedC= $self->didlistenD= $self->listen
ABCDresult
1XXX1
01XX1
001X1
00011
00000
103 $self->isconnected or $self->didlisten or $self->listen;
104 }
105 3 $self;
106 }
107  
108 1 1;
109  
110 # autoloaded methods go after the END token (& pod) below
111  
112 __END__
« blib/lib/Net/UDP.pm ↑ Summary Gen.xs »