Sample code for 30+ languages & platforms
Perl

Restart Transfer-Rate Measurement

See more Socket/SSL/TLS Examples

Demonstrates Socket.ResetPerf, which restarts one direction of connection-level transfer-rate measurement.

Background. Pass true to reset the receive measurement (RcvBytesPerSec) or false to reset the send measurement (SendBytesPerSec).

Chilkat Perl Downloads

Chilkat2 Perl
use strict;
use warnings;
use Chilkat2;

my $socket = Chilkat2::Socket->new;

# Connect to the server using TLS.
my $bTls = 1;
my $maxWaitMs = 5000;
my $success = $socket->Connect('example.com', 5000, $bTls, $maxWaitMs);
if (!$success) {
    print $socket->LastErrorText, "\n";
    exit;
}

# Restart one direction of transfer-rate measurement.  Pass 1 to reset the receive measurement
# (RcvBytesPerSec) or 0 to reset the send measurement (SendBytesPerSec).
my $bRcvPerf = 1;
$socket->ResetPerf($bRcvPerf);
print "Receive-rate measurement restarted.\n";