Delphi ActiveX
Delphi ActiveX
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 Delphi ActiveX Downloads
var
success: Integer;
socket: TChilkatSocket;
bTls: Integer;
maxWaitMs: Integer;
bRcvPerf: Integer;
begin
success := 0;
socket := TChilkatSocket.Create(Self);
// Connect to the server using TLS.
bTls := 1;
maxWaitMs := 5000;
success := socket.Connect('example.com',5000,bTls,maxWaitMs);
if (success = 0) then
begin
Memo1.Lines.Add(socket.LastErrorText);
Exit;
end;
// Restart one direction of transfer-rate measurement. Pass 1 to reset the receive measurement
// (RcvBytesPerSec) or 0 to reset the send measurement (SendBytesPerSec).
bRcvPerf := 1;
socket.ResetPerf(bRcvPerf);
Memo1.Lines.Add('Receive-rate measurement restarted.');