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

Cleaned up

This commit is contained in:
Tristan B. Kildaire 2021-01-30 16:39:47 +02:00
parent 1e3ca829fb
commit 6e75f84ba5
2 changed files with 22 additions and 9 deletions

View File

@ -180,6 +180,9 @@ public class DConnection : Thread
/* Leave all channels this connetion was a member of */ /* Leave all channels this connetion was a member of */
cleanUp_channels(); cleanUp_channels();
/* Delink this connection from this server */
cleanUp_delinkServers();
/* Remove this user from the connection queue */ /* Remove this user from the connection queue */
server.removeConnection(this); server.removeConnection(this);
@ -214,6 +217,20 @@ public class DConnection : Thread
gprintln(to!(string)(this)~" Leaving all channels... [done]"); gprintln(to!(string)(this)~" Leaving all channels... [done]");
} }
/**
* Part of the clean up process - `cleanUp()`
*
* Will de-link Will leave all channels this connection is
* a member of
*/
private void cleanUp_delinkServers()
{
if(connType == ConnectionType.SERVER)
{
}
}
/* TODO: add mutex for writing with message and funciton for doing so */ /* TODO: add mutex for writing with message and funciton for doing so */
/** /**
@ -412,7 +429,7 @@ public class DConnection : Thread
/* Add to the meyer system (this connectio) */ /* Add to the meyer system (this connectio) */
import dnetd.dlink : DLink; import dnetd.dlink : DLink;
DLink newLink = new DLink(server, serverNameIncoming, null, this); DLink newLink = new DLink(server, serverNameIncoming, this);
bool linkSuccessful = server.getMeyer().attachLink(serverNameIncoming, newLink); 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)); gprintln("Whether or not the link worked out (could be config error or possibly duplicate link): "~to!(string)(linkSuccessful));

View File

@ -211,20 +211,16 @@ public final class DLink : Thread
override public string toString() override public string toString()
{ {
return name; return name;
// return "Server: "~name~", Address: "~to!(string)(address);
} }
/** /**
* Constructs a DLink for an inbound peering * Constructs a DLink for an inbound peering
*/ */
this(DServer server, string name, Address address, DConnection connection) this(DServer server, string name, DConnection connection)
{ {
/* Save the server, name and address */ /* Save the server and name */
this(server, name, address=null);
/* Save the active connection */
/* Save name and address */
this(server, name, address);
/* Save connection */ /* Save connection */
//this.connection = connection; //this.connection = connection;