mirror of
https://github.com/deavmi/birchwood
synced 2024-09-20 03:23:37 +02:00
Receiver
- Added imports - Added a receive queue with a corresponding mutex - Added a field to hold the associated `Client` object Send - Added imports - Added a send queue with a corresponding mutex - Added a field to hold the associated `Client` object
This commit is contained in:
parent
8a9f48a3c7
commit
a999482fc9
@ -2,16 +2,32 @@ module birchwood.client.receiver;
|
||||
|
||||
import core.thread : Thread;
|
||||
|
||||
import std.container.slist : SList;
|
||||
import core.sync.mutex : Mutex;
|
||||
|
||||
// TODO: Examine the below import which seemingly fixes stuff for libsnooze
|
||||
import libsnooze.clib;
|
||||
import libsnooze;
|
||||
|
||||
import birchwood.client.core : Client;
|
||||
|
||||
public final class ReceiverThread : Thread
|
||||
{
|
||||
/**
|
||||
* The receive queue and its lock
|
||||
*/
|
||||
private SList!(ubyte[]) recvQueue;
|
||||
private Mutex recvQueueLock;
|
||||
|
||||
/**
|
||||
* The libsnooze event to await on which
|
||||
* when we wake up signals a new message
|
||||
* to be processed and received
|
||||
*/
|
||||
private Event receiveEvent;
|
||||
|
||||
/**
|
||||
* The associated IRC client
|
||||
*/
|
||||
private Client client;
|
||||
}
|
@ -2,16 +2,32 @@ module birchwood.client.sender;
|
||||
|
||||
import core.thread : Thread;
|
||||
|
||||
import std.container.slist : SList;
|
||||
import core.sync.mutex : Mutex;
|
||||
|
||||
// TODO: Examine the below import which seemingly fixes stuff for libsnooze
|
||||
import libsnooze.clib;
|
||||
import libsnooze;
|
||||
|
||||
import birchwood.client.core : Client;
|
||||
|
||||
public final class SenderThread : Thread
|
||||
{
|
||||
/**
|
||||
* The send queue and its lock
|
||||
*/
|
||||
private SList!(ubyte[]) sendQueue;
|
||||
private Mutex sendQueueLock;
|
||||
|
||||
/**
|
||||
* The libsnooze event to await on which
|
||||
* when we wake up signals a new message
|
||||
* to be processed and sent
|
||||
*/
|
||||
private Event receiveEvent;
|
||||
|
||||
/**
|
||||
* The associated IRC client
|
||||
*/
|
||||
private Client client;
|
||||
}
|
Loading…
Reference in New Issue
Block a user