diff --git a/source/app.d b/source/app.d index cc2d94d..1c0a2cd 100644 --- a/source/app.d +++ b/source/app.d @@ -5,6 +5,7 @@ import dnetd.dconfig : DConfig, DLinkConfig; import std.json; import std.exception; import gogga; +import dnetd.dlink : DLink, DMeyer; void main(string[] args) { @@ -76,14 +77,17 @@ void main(string[] args) /* Now configure the the linking */ DLinkConfig linkConfig = DLinkConfig.getConfig(dserver, json["links"]); - /* TODO: COnfigure here */ - - - /* TODO: Start meyer here (remove from inside DServer) */ + /* Get all server links */ + DLink[] serverLinks = linkConfig.getLinks(); + /* Create a new Meyer */ - /* Start the server */ + /* Attach the Meyer to the server */ + + + + /* Start the server (TODO: This should start Meyer) */ dserver.startServer(); } else diff --git a/source/dnetd/dconfig.d b/source/dnetd/dconfig.d index b81fdb6..869c32e 100644 --- a/source/dnetd/dconfig.d +++ b/source/dnetd/dconfig.d @@ -135,7 +135,6 @@ public final class DLinkConfig { /* Server links */ private DLink[] links; - private Address[] addresses; public static DLinkConfig getConfig(DServer dserver, JSONValue linksBlock) { @@ -170,7 +169,11 @@ public final class DLinkConfig dlinkConfig.links ~= new DLink(server, name, parseAddress(address, port)); } - return dlinkConfig; } + + public DLink[] getLinks() + { + return links; + } } \ No newline at end of file diff --git a/source/dnetd/dlink.d b/source/dnetd/dlink.d index 4b347d9..798be49 100644 --- a/source/dnetd/dlink.d +++ b/source/dnetd/dlink.d @@ -60,6 +60,9 @@ public final class DLink : Thread */ this(DServer server, string name, Address address) { + /* Set the worker thread for outbound connections */ + super(&outboundWorker); + /* Create an outbound connection */ /* TODO: Fuuuuuuuuuuuuuuuuuuuck handling of shit here bababooey and not in dconnection.d as we would have done below */ @@ -76,6 +79,12 @@ public final class DLink : Thread // connection = new DConnection(); } + private void outboundWorker() + { + /* TODO: Implement me */ + } + + /** * Constructs a DLink for an inbound peering */