mirror of
https://github.com/glest/glest-source.git
synced 2025-08-16 21:33:59 +02:00
try to improve performance
This commit is contained in:
@@ -287,11 +287,14 @@ void ConnectionSlotThread::execute() {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//bool socketHasReadData = socket->hasDataToReadWithWait(1000);
|
||||||
|
bool socketHasReadData = socket->hasDataToRead();;
|
||||||
|
|
||||||
ConnectionSlotEvent eventCopy;
|
ConnectionSlotEvent eventCopy;
|
||||||
eventCopy.eventType = eReceiveSocketData;
|
eventCopy.eventType = eReceiveSocketData;
|
||||||
eventCopy.connectionSlot = slot;
|
eventCopy.connectionSlot = slot;
|
||||||
eventCopy.eventId = slotIndex;
|
eventCopy.eventId = slotIndex;
|
||||||
eventCopy.socketTriggered = socket->hasDataToReadWithWait(1000);
|
eventCopy.socketTriggered = socketHasReadData;
|
||||||
//eventCopy.socketTriggered = true;
|
//eventCopy.socketTriggered = true;
|
||||||
|
|
||||||
if(getQuitStatus() == true) {
|
if(getQuitStatus() == true) {
|
||||||
@@ -302,6 +305,10 @@ void ConnectionSlotThread::execute() {
|
|||||||
//printf("#C Checking action for slot: %d\n",slotIndex);
|
//printf("#C Checking action for slot: %d\n",slotIndex);
|
||||||
this->slotUpdateTask(&eventCopy);
|
this->slotUpdateTask(&eventCopy);
|
||||||
//printf("#D Checking action for slot: %d\n",slotIndex);
|
//printf("#D Checking action for slot: %d\n",slotIndex);
|
||||||
|
|
||||||
|
if(socketHasReadData == false && getQuitStatus() == false) {
|
||||||
|
sleep(10);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
//printf("#1 Checking action for slot: %d\n",slotIndex);
|
//printf("#1 Checking action for slot: %d\n",slotIndex);
|
||||||
|
Reference in New Issue
Block a user