Sample code for 30+ languages & platforms
PowerShell

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

PowerShell
Add-Type -Path "C:\chilkat\ChilkatDotNet47-x64\ChilkatDotNet47.dll"

$success = $false

$socket = New-Object Chilkat.Socket

#  Connect to the server using TLS.
$bTls = $true
$maxWaitMs = 5000
$success = $socket.Connect("example.com",5000,$bTls,$maxWaitMs)
if ($success -eq $false) {
    $($socket.LastErrorText)
    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)
$("Receive-rate measurement restarted.")