1
0
mirror of https://github.com/deavminet/dnetd synced 2024-09-21 09:43:37 +02:00

That should make linking work now

This commit is contained in:
Tristan B. Kildaire 2021-01-30 14:27:31 +02:00
parent 7cd4b4af8d
commit 998f8060bf
4 changed files with 8 additions and 6 deletions

View File

@ -85,6 +85,8 @@ void main(string[] args)
/* Start the server (TODO: This should start Meyer) */
dserver.startServer();
dserver.startOutboundLinks(serverLinks);
}
catch(JSONException e)
{

View File

@ -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));

View File

@ -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;
}

View File

@ -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();
}