Sample code for 30+ languages & platforms
Tcl

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

Tcl

load ./chilkat.dll

set success 0

set socket [new_CkSocket]

#  Connect to the server using TLS.
set bTls 1
set maxWaitMs 5000
set success [CkSocket_Connect $socket "example.com" 5000 $bTls $maxWaitMs]
if {$success == 0} then {
    puts [CkSocket_lastErrorText $socket]
    delete_CkSocket $socket
    exit
}

#  Restart one direction of transfer-rate measurement.  Pass 1 to reset the receive measurement
#  (RcvBytesPerSec) or 0 to reset the send measurement (SendBytesPerSec).
set bRcvPerf 1
CkSocket_ResetPerf $socket $bRcvPerf
puts "Receive-rate measurement restarted."

delete_CkSocket $socket