mirror of
https://github.com/deavmi/birchwood
synced 2024-09-20 11:02:51 +02:00
Receiver
- Added missing documentation - Removed commented-out code block Sender - Added missing documentation - Removed commented-out code block
This commit is contained in:
parent
a1b739e8b7
commit
fc63aaae49
@ -15,13 +15,18 @@ import birchwood.client;
|
||||
import birchwood.protocol.messages : Message, decodeMessage;
|
||||
import std.string : indexOf;
|
||||
import birchwood.client.events : PongEvent, IRCEvent;
|
||||
import std.string : cmp;
|
||||
|
||||
public final class ReceiverThread : Thread
|
||||
{
|
||||
/**
|
||||
* The receive queue and its lock
|
||||
* The receive queue
|
||||
*/
|
||||
private SList!(ubyte[]) recvQueue;
|
||||
|
||||
/**
|
||||
* The receive queue's lock
|
||||
*/
|
||||
private Mutex recvQueueLock;
|
||||
|
||||
/**
|
||||
@ -151,7 +156,6 @@ public final class ReceiverThread : Thread
|
||||
Message pingMessage;
|
||||
foreach(Message curMsg; currentMessageQueue[])
|
||||
{
|
||||
import std.string : cmp;
|
||||
if(cmp(curMsg.getCommand(), "PING") == 0)
|
||||
{
|
||||
currentMessageQueue.linearRemoveElement(curMsg);
|
||||
@ -221,15 +225,13 @@ public final class ReceiverThread : Thread
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Stops the receive queue manager
|
||||
*/
|
||||
public void end()
|
||||
{
|
||||
// TODO: See above notes about libsnooze behaviour due
|
||||
// ... to usage in our context
|
||||
receiveEvent.notifyAll();
|
||||
}
|
||||
|
||||
// public bool isReady()
|
||||
// {
|
||||
// return hasEnsured;
|
||||
// }
|
||||
}
|
@ -14,9 +14,13 @@ import birchwood.client;
|
||||
public final class SenderThread : Thread
|
||||
{
|
||||
/**
|
||||
* The send queue and its lock
|
||||
* The send queue
|
||||
*/
|
||||
private SList!(ubyte[]) sendQueue;
|
||||
|
||||
/**
|
||||
* The send queue's lock
|
||||
*/
|
||||
private Mutex sendQueueLock;
|
||||
|
||||
/**
|
||||
@ -130,15 +134,13 @@ public final class SenderThread : Thread
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Stops the send queue manager
|
||||
*/
|
||||
public void end()
|
||||
{
|
||||
// TODO: See above notes about libsnooze behaviour due
|
||||
// ... to usage in our context
|
||||
sendEvent.notifyAll();
|
||||
}
|
||||
|
||||
// public bool isReady()
|
||||
// {
|
||||
// return hasEnsured;
|
||||
// }
|
||||
}
|
Loading…
Reference in New Issue
Block a user