| 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
| |||||||||||
| 14 | 1 | my $msg_sock = $srv->accept(); | |||||||||
| 15 | 1 | my $buf; | |||||||||
| 16 | 1 | ▶ | while ($msg_sock->sysread($buf, 1024)) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 17 | 32768 | $msg_sock->syswrite($buf, length($buf)); | |||||||||
| 18 | } | ||||||||||
| 19 | 1 | return 0; | |||||||||
| 20 | } | ||||||||||
| 21 | |||||||||||
| 22 | 4 | 1; | |||||||||
| 23 | |||||||||||
| 24 | __END__ | ||||||||||