Netperf/Server.pm

filter: Statementstmt 100% 20 / 20 Branchbran 75.0% 3 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 4 / 4 Podpod 100% 1 / 1 totaltotal 96.5% 28 / 29 CC 3 SCAR 6.9
CC
3
Cov
96%
run
3.0
BEGIN
1.0
BEGIN
1.0
CRAP 2.0
« Netperf/Client.pm ↑ Summary Netperf.pm »
1 package Tapper::TestSuite::Netperf::Server;
2 4 our $AUTHORITY = 'cpan:TAPPER';
3 # ABSTRACT: Tapper - Network performance measurements - Server
4 4 $Tapper::TestSuite::Netperf::Server::VERSION = '5.0.0';
5 4 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 4 ▶ use IO::Handle;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 4 ▶ use IO::Socket::INET;
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 1 ▶ sub run {
Subroutine run: called CC=3 SCAR=11.0
Pod documented
10 1 my ($self) = @_;
11  
12 1 my $srv = IO::Socket::INET->new( LocalPort => 5000, Listen => 5);
13 1 ▶ return "Can not open server socket:$!" if not $srv;
Branch: 1 branch
BranchTrueFalseTotal
unless $srv 0 1 1
14 1 my $msg_sock = $srv->accept();
15 1 my $buf;
16 1 ▶ while ($msg_sock->sysread($buf, 1024)) {
Branch: 1 branch
BranchTrueFalseTotal
if ($msg_sock->sysread($buf, 1024)) 32768 1 32769
17 32768 $msg_sock->syswrite($buf, length($buf));
18 }
19 1 return 0;
20 }
21  
22 4 1;
23  
24 __END__
« Netperf/Client.pm ↑ Summary Netperf.pm »