bugfix to cleanup closing client connections quickly
This commit is contained in:
parent
8cd2383a78
commit
03862948e2
|
@ -457,8 +457,11 @@ ConnectionSlot::~ConnectionSlot() {
|
||||||
if(SystemFlags::getSystemSettingType(SystemFlags::debugNetwork).enabled) SystemFlags::OutputDebug(SystemFlags::debugNetwork,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
if(SystemFlags::getSystemSettingType(SystemFlags::debugNetwork).enabled) SystemFlags::OutputDebug(SystemFlags::debugNetwork,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||||
|
|
||||||
//printf("#1 Ending client SLOT: %d slotThreadWorker: %p\n",playerIndex,slotThreadWorker);
|
//printf("#1 Ending client SLOT: %d slotThreadWorker: %p\n",playerIndex,slotThreadWorker);
|
||||||
|
if(slotThreadWorker != NULL) {
|
||||||
if(slotThreadWorker != NULL && slotThreadWorker->getRunningStatus() == false) {
|
slotThreadWorker->signalQuit();
|
||||||
|
}
|
||||||
|
if(slotThreadWorker != NULL && slotThreadWorker->canShutdown(false) == true &&
|
||||||
|
slotThreadWorker->getRunningStatus() == false) {
|
||||||
//printf("#2 Ending client SLOT: %d\n",playerIndex);
|
//printf("#2 Ending client SLOT: %d\n",playerIndex);
|
||||||
|
|
||||||
if(SystemFlags::getSystemSettingType(SystemFlags::debugNetwork).enabled) SystemFlags::OutputDebug(SystemFlags::debugNetwork,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
if(SystemFlags::getSystemSettingType(SystemFlags::debugNetwork).enabled) SystemFlags::OutputDebug(SystemFlags::debugNetwork,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||||
|
@ -466,12 +469,17 @@ ConnectionSlot::~ConnectionSlot() {
|
||||||
if(SystemFlags::getSystemSettingType(SystemFlags::debugNetwork).enabled) SystemFlags::OutputDebug(SystemFlags::debugNetwork,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
if(SystemFlags::getSystemSettingType(SystemFlags::debugNetwork).enabled) SystemFlags::OutputDebug(SystemFlags::debugNetwork,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||||
}
|
}
|
||||||
//else if(BaseThread::shutdownAndWait(slotThreadWorker) == true) {
|
//else if(BaseThread::shutdownAndWait(slotThreadWorker) == true) {
|
||||||
if(slotThreadWorker != NULL && slotThreadWorker->canShutdown(true) == true) {
|
else if(slotThreadWorker != NULL && slotThreadWorker->canShutdown(true) == true) {
|
||||||
//printf("#3 Ending client SLOT: %d\n",playerIndex);
|
if(slotThreadWorker->getRunningStatus() == false) {
|
||||||
|
//printf("#3 Ending client SLOT: %d\n",playerIndex);
|
||||||
if(SystemFlags::getSystemSettingType(SystemFlags::debugNetwork).enabled) SystemFlags::OutputDebug(SystemFlags::debugNetwork,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
if(SystemFlags::getSystemSettingType(SystemFlags::debugNetwork).enabled) SystemFlags::OutputDebug(SystemFlags::debugNetwork,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||||
delete slotThreadWorker;
|
delete slotThreadWorker;
|
||||||
if(SystemFlags::getSystemSettingType(SystemFlags::debugNetwork).enabled) SystemFlags::OutputDebug(SystemFlags::debugNetwork,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
if(SystemFlags::getSystemSettingType(SystemFlags::debugNetwork).enabled) SystemFlags::OutputDebug(SystemFlags::debugNetwork,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
slotThreadWorker->setDeleteSelfOnExecutionDone(true);
|
||||||
|
slotThreadWorker->setDeleteAfterExecute(true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
//printf("#4 Ending client SLOT: %d\n",playerIndex);
|
//printf("#4 Ending client SLOT: %d\n",playerIndex);
|
||||||
slotThreadWorker = NULL;
|
slotThreadWorker = NULL;
|
||||||
|
|
|
@ -478,6 +478,7 @@ void ServerInterface::removeSlot(int playerIndex, int lockedSlotIndex) {
|
||||||
safeMutexSlot.ReleaseLock();
|
safeMutexSlot.ReleaseLock();
|
||||||
safeMutex.ReleaseLock();
|
safeMutex.ReleaseLock();
|
||||||
if(SystemFlags::getSystemSettingType(SystemFlags::debugNetwork).enabled) SystemFlags::OutputDebug(SystemFlags::debugNetwork,"In [%s::%s Line: %d] playerIndex = %d, lockedSlotIndex = %d\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,playerIndex,lockedSlotIndex);
|
if(SystemFlags::getSystemSettingType(SystemFlags::debugNetwork).enabled) SystemFlags::OutputDebug(SystemFlags::debugNetwork,"In [%s::%s Line: %d] playerIndex = %d, lockedSlotIndex = %d\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,playerIndex,lockedSlotIndex);
|
||||||
|
if(slot != NULL) slot->close();
|
||||||
delete slot;
|
delete slot;
|
||||||
if(SystemFlags::getSystemSettingType(SystemFlags::debugNetwork).enabled) SystemFlags::OutputDebug(SystemFlags::debugNetwork,"In [%s::%s Line: %d] playerIndex = %d, lockedSlotIndex = %d\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,playerIndex,lockedSlotIndex);
|
if(SystemFlags::getSystemSettingType(SystemFlags::debugNetwork).enabled) SystemFlags::OutputDebug(SystemFlags::debugNetwork,"In [%s::%s Line: %d] playerIndex = %d, lockedSlotIndex = %d\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,playerIndex,lockedSlotIndex);
|
||||||
updateListen();
|
updateListen();
|
||||||
|
|
Loading…
Reference in New Issue