Sample code for 30+ languages & platforms
PHP

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 PHP Downloads

Chilkat2 PHP
<?php

use Chilkat2\Socket;

$socket = new Socket();

// Connect to the server using TLS.
$bTls = true;
$maxWaitMs = 5000;
try {
    $socket->Connect('example.com', 5000, $bTls, $maxWaitMs);
} catch (\Chilkat2\Exception $e) {
    echo $e->getMessage(), "\n";
    exit;
}

// Restart one direction of transfer-rate measurement.  Pass true to reset the receive measurement
// (RcvBytesPerSec) or false to reset the send measurement (SendBytesPerSec).
$bRcvPerf = true;
$socket->ResetPerf($bRcvPerf);
echo "Receive-rate measurement restarted.\n";