Sample code for 30+ languages & platforms
AutoIt

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

AutoIt
Local $bSuccess = False

$oSocket = ObjCreate("Chilkat.Socket")

;  Connect to the server using TLS.
Local $bTls = True
Local $iMaxWaitMs = 5000
$bSuccess = $oSocket.Connect("example.com",5000,$bTls,$iMaxWaitMs)
If ($bSuccess = False) Then
    ConsoleWrite($oSocket.LastErrorText & @CRLF)
    Exit
EndIf

;  Restart one direction of transfer-rate measurement.  Pass True to reset the receive measurement
;  (RcvBytesPerSec) or False to reset the send measurement (SendBytesPerSec).
Local $bRcvPerf = True
$oSocket.ResetPerf $bRcvPerf
ConsoleWrite("Receive-rate measurement restarted." & @CRLF)