From 5021c5038ce2f36735bbe6ba3503d3eece938351 Mon Sep 17 00:00:00 2001 From: "Tristan B. Kildaire" Date: Sat, 30 Jan 2021 11:39:58 +0200 Subject: [PATCH] WIP: Send LINK command --- source/dnetd/dlink.d | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/source/dnetd/dlink.d b/source/dnetd/dlink.d index dbd96e3..0b00a22 100644 --- a/source/dnetd/dlink.d +++ b/source/dnetd/dlink.d @@ -127,6 +127,16 @@ public final class DLink : Thread /* Initialize a new outbound connection */ initializeOutboundConnection(); + /* TODO: Send LINK (1) command */ + byte[] data; + data ~= [1]; + + /* TODO: Encode [nameLen, name] */ + import tristanable.encoding : DataMessage; + + DataMessage message = new DataMessage(0, [1]); + + /* TODO: Implement me */ while(true) { @@ -156,6 +166,7 @@ public final class DLink : Thread } } +/* TODO: Remove this from here and put it in DServer */ public final class DMeyer { /* Direct peers */ @@ -192,3 +203,11 @@ public final class DMeyer return outboundPeers; } } + +/** +* Initializes a new inbound connection that is to be used for linking +*/ +void initializeLink(DServer server, DConnection newConnection) +{ + +} \ No newline at end of file