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