Unicode C
Unicode 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 Unicode C Downloads
#include <C_CkSocketW.h>
void ChilkatSample(void)
{
BOOL success;
HCkSocketW socket;
BOOL bTls;
int maxWaitMs;
BOOL bRcvPerf;
success = FALSE;
socket = CkSocketW_Create();
// Connect to the server using TLS.
bTls = TRUE;
maxWaitMs = 5000;
success = CkSocketW_Connect(socket,L"example.com",5000,bTls,maxWaitMs);
if (success == FALSE) {
wprintf(L"%s\n",CkSocketW_lastErrorText(socket));
CkSocketW_Dispose(socket);
return;
}
// 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;
CkSocketW_ResetPerf(socket,bRcvPerf);
wprintf(L"Receive-rate measurement restarted.\n");
CkSocketW_Dispose(socket);
}