C++
C++
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 C++ Downloads
#include <CkSocket.h>
void ChilkatSample(void)
{
bool success = false;
CkSocket socket;
// Connect to the server using TLS.
bool bTls = true;
int maxWaitMs = 5000;
success = socket.Connect("example.com",5000,bTls,maxWaitMs);
if (success == false) {
std::cout << socket.lastErrorText() << "\r\n";
return;
}
// Restart one direction of transfer-rate measurement. Pass true to reset the receive measurement
// (RcvBytesPerSec) or false to reset the send measurement (SendBytesPerSec).
bool bRcvPerf = true;
socket.ResetPerf(bRcvPerf);
std::cout << "Receive-rate measurement restarted." << "\r\n";
}