Sample code for 30+ languages & platforms
Chilkat2-Python

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 Chilkat2-Python Downloads

Chilkat2-Python
import sys
import chilkat2

success = False

socket = chilkat2.Socket()

# Connect to the server using TLS.
bTls = True
maxWaitMs = 5000
success = socket.Connect("example.com",5000,bTls,maxWaitMs)
if (success == False):
    print(socket.LastErrorText)
    sys.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)
print("Receive-rate measurement restarted.")