mirror of
https://github.com/glest/glest-source.git
synced 2025-08-16 21:33:59 +02:00
Bugfix for tracker#: 2985599
- Added better management of UDP broadcast thread when user toggles on/off network slots.
This commit is contained in:
@@ -1250,7 +1250,7 @@ void ServerSocket::stopBroadCastThread() {
|
||||
break;
|
||||
}
|
||||
sleep(100);
|
||||
SystemFlags::OutputDebug(SystemFlags::debugNetwork,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||
//SystemFlags::OutputDebug(SystemFlags::debugNetwork,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||
}
|
||||
SystemFlags::OutputDebug(SystemFlags::debugNetwork,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||
|
||||
@@ -1272,6 +1272,16 @@ void ServerSocket::startBroadCastThread() {
|
||||
SystemFlags::OutputDebug(SystemFlags::debugNetwork,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||
}
|
||||
|
||||
bool ServerSocket::isBroadCastThreadRunning() {
|
||||
SystemFlags::OutputDebug(SystemFlags::debugNetwork,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||
|
||||
bool isThreadRunning = (broadCastThread != NULL && broadCastThread->getRunningStatus() == true);
|
||||
|
||||
SystemFlags::OutputDebug(SystemFlags::debugNetwork,"In [%s::%s Line: %d] isThreadRunning = %d\n",__FILE__,__FUNCTION__,__LINE__,isThreadRunning);
|
||||
|
||||
return isThreadRunning;
|
||||
}
|
||||
|
||||
void ServerSocket::bind(int port)
|
||||
{
|
||||
//sockaddr structure
|
||||
@@ -1302,7 +1312,14 @@ void ServerSocket::listen(int connectionQueueSize)
|
||||
throwException(szBuf);
|
||||
}
|
||||
|
||||
startBroadCastThread();
|
||||
if(connectionQueueSize > 0) {
|
||||
if(isBroadCastThreadRunning() == false) {
|
||||
startBroadCastThread();
|
||||
}
|
||||
}
|
||||
else {
|
||||
stopBroadCastThread();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user