Skip to content

Commit

Permalink
For TCP netbench does not set idle and ignores timeout error.
Browse files Browse the repository at this point in the history
  • Loading branch information
bluhm committed Jan 25, 2024
1 parent 92af7a2 commit b43d22d
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions netbench.pl
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,11 @@
print_status_tcp() if $testmode{tcp};
print_status_udp() if $testmode{udp};

# timeout always fails with error
if ($testmode{tcp}) {
delete $_->{status} foreach (@servers);
}

my @failed = map { $_->{status} ? $_->{name} : () }
(@clients, @relays, @servers);
die "Process '@failed' failed" if @failed;
Expand All @@ -174,7 +179,7 @@ sub start_server_tcp {
my $timeout = 2;
$timeout += $opts{t} if defined($opts{t});
my @cmd = ('tcpbench', '-s');
unshift @cmd, ('timeout', $timeout) if $opts{t};
unshift @cmd, ('timeout', '-p', $timeout) if $opts{t};
push @cmd, "-b$proc->{addr}";
push @cmd, "-p$proc->{port}";
push @cmd, "-S$opts{b}" if defined($opts{b});
Expand Down Expand Up @@ -257,7 +262,7 @@ sub start_relay {
push @cmd, '-c' if $testmode{copy};
push @cmd, '-u' if $testmode{udp};
push @cmd, "-b$opts{b}" if defined($opts{b});
push @cmd, "-i0";
push @cmd, "-i0" if $testmode{udp};
push @cmd, "-N$opts{N}" if defined($opts{N}) && $testmode{udp};
push @cmd, "-n$opts{N}" if defined($opts{N}) && $testmode{tcp};
push @cmd, "-t$timeout" if defined($opts{t});
Expand Down

0 comments on commit b43d22d

Please sign in to comment.