Sample code for 30+ languages & platforms
VB.NET

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 VB.NET Downloads

VB.NET
Dim success As Boolean = False

Dim socket As New Chilkat.Socket

'  Connect to the server using TLS.
Dim bTls As Boolean = True
Dim maxWaitMs As Integer = 5000
success = socket.Connect("example.com",5000,bTls,maxWaitMs)
If (success = False) Then
    Debug.WriteLine(socket.LastErrorText)
    Exit Sub
End If


'  Restart one direction of transfer-rate measurement.  Pass True to reset the receive measurement
'  (RcvBytesPerSec) or False to reset the send measurement (SendBytesPerSec).
Dim bRcvPerf As Boolean = True
socket.ResetPerf(bRcvPerf)
Debug.WriteLine("Receive-rate measurement restarted.")