React Native
React Native
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 React Native Downloads
import { Socket } from '@chilkat/react-native'
async function chilkatExample() {
const socket = new Socket();
// Connect to the server using TLS.
const bTls = true;
const maxWaitMs = 5000;
try {
await socket.connectAsync('example.com', 5000, bTls, maxWaitMs);
} catch {
console.log(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).
const bRcvPerf = true;
socket.resetPerf(bRcvPerf);
console.log('Receive-rate measurement restarted.');
}