Ref T150, Ref T156 overloading canPing

This commit is contained in:
Klaus Basan
2017-09-14 17:21:55 +02:00
committed by Mathew Sutcliffe
parent fedcd76a05
commit b01c7d6333
2 changed files with 10 additions and 0 deletions

View File

@@ -77,6 +77,12 @@ namespace BlackMisc
return exitCode == 0;
}
bool CNetworkUtils::canPing(const CUrl &url)
{
if (url.isEmpty()) { return false; }
return CNetworkUtils::canPing(url.getHost());
}
QStringList CNetworkUtils::getKnownLocalIpV4Addresses()
{
QStringList ips;

View File

@@ -55,6 +55,10 @@ namespace BlackMisc
//! \note uses OS ping
static bool canPing(const QString &hostAddress);
//! Can ping the address?
//! \note uses OS ping
static bool canPing(const BlackMisc::Network::CUrl &url);
//! Can connect?
//! \param hostAddress 130.4.20.3, or myserver.com
//! \param port 80, 1234