mirror of
https://github.com/glest/glest-source.git
synced 2025-08-19 22:51:24 +02:00
updated ping logic
This commit is contained in:
@@ -688,6 +688,7 @@ Socket::Socket()
|
|||||||
|
|
||||||
float Socket::getThreadedPingMS(std::string host) {
|
float Socket::getThreadedPingMS(std::string host) {
|
||||||
if(pingThread == NULL) {
|
if(pingThread == NULL) {
|
||||||
|
lastThreadedPing = 0;
|
||||||
pingThread = new SimpleTaskThread(this,0,50);
|
pingThread = new SimpleTaskThread(this,0,50);
|
||||||
pingThread->start();
|
pingThread->start();
|
||||||
}
|
}
|
||||||
@@ -1753,7 +1754,7 @@ void BroadCastSocketThread::execute() {
|
|||||||
float Socket::getAveragePingMS(std::string host, int pingCount) {
|
float Socket::getAveragePingMS(std::string host, int pingCount) {
|
||||||
double result = -1;
|
double result = -1;
|
||||||
|
|
||||||
const bool debugPingOutput = true;
|
const bool debugPingOutput = false;
|
||||||
char szCmd[1024]="";
|
char szCmd[1024]="";
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
sprintf(szCmd,"ping -n %d %s",pingCount,host.c_str());
|
sprintf(szCmd,"ping -n %d %s",pingCount,host.c_str());
|
||||||
|
Reference in New Issue
Block a user