Sample code for 30+ languages & platforms
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

C
#include <C_CkSocket.h>

void ChilkatSample(void)
    {
    BOOL success;
    HCkSocket socket;
    BOOL bTls;
    int maxWaitMs;
    BOOL bRcvPerf;

    success = FALSE;

    socket = CkSocket_Create();

    //  Connect to the server using TLS.
    bTls = TRUE;
    maxWaitMs = 5000;
    success = CkSocket_Connect(socket,"example.com",5000,bTls,maxWaitMs);
    if (success == FALSE) {
        printf("%s\n",CkSocket_lastErrorText(socket));
        CkSocket_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;
    CkSocket_ResetPerf(socket,bRcvPerf);
    printf("Receive-rate measurement restarted.\n");


    CkSocket_Dispose(socket);

    }