From f3016c7b549b0259fe9a106eb8fcabd03d133d40 Mon Sep 17 00:00:00 2001 From: fong Date: Thu, 1 Feb 2024 10:55:59 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8DPing=E7=9A=84BUG=20Signed-off?= =?UTF-8?q?-by:=20fong=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ip_sacaner/scan_run.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/ip_sacaner/scan_run.cpp b/ip_sacaner/scan_run.cpp index 0ac6b8c..5d99076 100644 --- a/ip_sacaner/scan_run.cpp +++ b/ip_sacaner/scan_run.cpp @@ -26,13 +26,15 @@ quint32 ipv4str_to_int(const QString& ipstr) } } -bool Ping(QString strPingIP) +bool Ping(QString strPingIP,qint16 timeout) { QProcess pingProcess; - QString strArg = "ping " + strPingIP + " -n 1 -i 2"; + QString strArg = "ping " + strPingIP + " -n 2 -w "+QString("%1").arg(timeout);// + " -n 1 -i 2"; + qDebug()<