WIP: Moving over to queue_sys for tristsnabale

This commit is contained in:
Tristan B. Kildaire 2020-10-15 11:48:32 +02:00
parent 48e3e261bf
commit d110c95d12
1 changed files with 16 additions and 0 deletions

View File

@ -1,6 +1,7 @@
module libdnet.dclient;
import tristanable.manager : Manager;
import tristanable.queue : Queue;
import std.socket;
import std.stdio;
import std.conv : to;
@ -29,13 +30,28 @@ public final class DClient
this(Address address)
{
/* Initialize the socket */
/* TODO: Error handling */
Socket socket = new Socket(address.addressFamily, SocketType.STREAM, ProtocolType.TCP);
socket.connect(address);
/* Initialize tristanable */
initTristanable(socket);
}
private void initTristanable(Socket socket)
{
/* Initialize the manager */
manager = new Manager(socket);
/* Create a queue for normal traffic (request-reply) */
Queue reqRepQueue = new Queue(0);
/* Create a queue for notifications (replies-only) */
Queue notificationQueue = new Queue(1);
}
/**
* Authenticates as a client with the server
*