Hi All!
While a go I asked how to ping server and get respond.
I've got some answer but it only tells me that server is responding.
How to get similar thing as it on win shell cmd with the number of packets received or lost and time of respond?
Thank you for any help in advance.
While a go I asked how to ping server and get respond.
I've got some answer but it only tells me that server is responding.
How to get similar thing as it on win shell cmd with the number of packets received or lost and time of respond?
B4X:
Sub Ping(ipaddress As String)
Log("started")
Dim shl As Shell
Dim lstParams As List: lstParams.Initialize
Try
Dim os As String = GetSystemProperty("os.name", "").ToLowerCase
If os.Contains("win") Then
Log("Windows")
'Windows
lstParams.Add("-n")
Else
'Linux and Mac
lstParams.Add("-c")
End If
lstParams.Add("1")
lstParams.Add(ipaddress)
shl.Initialize("shl", "ping", lstParams)
shl.WorkingDirectory = File.DirApp
shl.Run(-1)
Catch
Log(LastException.Message)
End Try
End Sub
Thank you for any help in advance.