From d110c95d1205190b37b9c04df720afba68e72961 Mon Sep 17 00:00:00 2001 From: "Tristan B. Kildaire" Date: Thu, 15 Oct 2020 11:48:32 +0200 Subject: [PATCH] WIP: Moving over to queue_sys for tristsnabale --- source/libdnet/dclient.d | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/source/libdnet/dclient.d b/source/libdnet/dclient.d index dacc70c..50cb6d9 100644 --- a/source/libdnet/dclient.d +++ b/source/libdnet/dclient.d @@ -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 *