diff --git a/source/app.d b/source/app.d index 73f00ed..14db750 100644 --- a/source/app.d +++ b/source/app.d @@ -85,6 +85,8 @@ void main(string[] args) /* Start the server (TODO: This should start Meyer) */ dserver.startServer(); + + dserver.startOutboundLinks(serverLinks); } catch(JSONException e) { diff --git a/source/dnetd/dconnection.d b/source/dnetd/dconnection.d index 232aeaa..4fafdf5 100644 --- a/source/dnetd/dconnection.d +++ b/source/dnetd/dconnection.d @@ -396,7 +396,7 @@ public class DConnection : Thread /* Add to the meyer system (this connectio) */ import dnetd.dlink : DLink; - DLink newLink = new DLink(server, serverNameIncoming, null); + DLink newLink = new DLink(server, serverNameIncoming, null, this); bool linkSuccessful = server.getMeyer().attachLink(serverNameIncoming, newLink); gprintln("Whether or not the link worked out (could be config error or possibly duplicate link): "~to!(string)(linkSuccessful)); diff --git a/source/dnetd/dlink.d b/source/dnetd/dlink.d index 700f3ae..331b906 100644 --- a/source/dnetd/dlink.d +++ b/source/dnetd/dlink.d @@ -256,7 +256,7 @@ public final class DMeyer /* TODO: Open connections to all servers we are yet to open a connection to (check the `links` array) */ - this.links = links; + //this.links = links; } diff --git a/source/dnetd/dserver.d b/source/dnetd/dserver.d index a8bef0e..a38167c 100644 --- a/source/dnetd/dserver.d +++ b/source/dnetd/dserver.d @@ -164,7 +164,7 @@ public class DServer : Thread start(); /* Start outbound server linking */ - startOutboundLinks(); + //startOutboundLinks(); gprintln("poes"); } @@ -174,12 +174,12 @@ public class DServer : Thread * establish an outbound connection and therefore * connection handler for each of them */ - private void startOutboundLinks() + public void startOutboundLinks(DLink[] linksTest) { - DLink[] serverLinks = meyerSS.getLinks(); + //DLink[] serverLinks = meyerSS.getLinks(); /* Start all DLink outbound handlers (TODO: Move to DServer) */ - foreach(DLink link; serverLinks) + foreach(DLink link; linksTest) { link.start(); }