KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: Ping scripts to help troubleshoot network issues
PRODUCT: 4D | VERSION: 19 | PLATFORM: Mac & Win
Published On: May 31, 2022

Network issues can be difficult to troubleshoot especially when a disconnect could either be related or unrelated to 4D. To help narrow down whether it's specifically a network issue, a ping script is provided below that pings google every second and writes the output to a file:

For Windows (Powershell, save as .ps1 file):
$FolderName = "C:\temp\"

if(-Not [System.IO.Directory]::Exists($FolderName))
{
#PowerShell Create directory if not exists
New-Item $FolderName -ItemType Directory
Write-Host "Folder Created successfully"
}

ping.exe -t google.com|Foreach{"{0} - {1}" -f (Get-Date),$_} > C:\temp\$(Get-Date -UFormat "%Y%m%d_%H%m%S").txt

For Mac:
ping --apple-time google.com | tee ~/Desktop/$(date +%Y%m%d_%H%M%S_ping).txt

If the output file contains a series of Request timed out at the same time a client disconnects from 4D Server, this indicates that the issue persists within the reliability of the network connection rather than 4D. Try these ping tests when testing the reliability of a network.