mirror of
https://github.com/deavmi/birchwood
synced 2024-09-20 16:23:39 +02:00
Receiver
- Instead of locking, processing a potential pong and ONE normal message and then unlocking, now we process all messages we have
This commit is contained in:
parent
9d7682bfdb
commit
e3b2be121b
@ -110,10 +110,6 @@ public final class ReceiverThread : Thread
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
pos++;
|
pos++;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -164,8 +160,11 @@ public final class ReceiverThread : Thread
|
|||||||
client.engine.push(pongEvent);
|
client.engine.push(pongEvent);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Now let's go message by message */
|
/**
|
||||||
if(!recvQueue.empty())
|
* Process each message remaining in the queue now
|
||||||
|
* till it is empty
|
||||||
|
*/
|
||||||
|
while(!recvQueue.empty())
|
||||||
{
|
{
|
||||||
ubyte[] message = recvQueue.front();
|
ubyte[] message = recvQueue.front();
|
||||||
|
|
||||||
@ -188,6 +187,7 @@ public final class ReceiverThread : Thread
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* Unlock the receive queue */
|
/* Unlock the receive queue */
|
||||||
recvQueueLock.unlock();
|
recvQueueLock.unlock();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user