Objective-C
Objective-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 Objective-C Downloads
#import <CkoSocket.h>
BOOL success = NO;
CkoSocket *socket = [[CkoSocket alloc] init];
// Connect to the server using TLS.
BOOL bTls = YES;
int maxWaitMs = 5000;
success = [socket Connect: @"example.com" port: [NSNumber numberWithInt: 5000] ssl: bTls maxWaitMs: [NSNumber numberWithInt: maxWaitMs]];
if (success == NO) {
NSLog(@"%@",socket.LastErrorText);
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 = YES;
[socket ResetPerf: bRcvPerf];
NSLog(@"%@",@"Receive-rate measurement restarted.");