The dserver now starts all constructed listeners

This commit is contained in:
Tristan B. Kildaire 2020-12-20 17:47:15 +02:00
parent 9e3da7d09f
commit 917402e974
2 changed files with 17 additions and 3 deletions

View File

@ -41,11 +41,13 @@ public final class DListener : Thread
gprintln("New listener started with address "~to!(string)(addressInfo));
/* Start the connection dequeue thread */
start();
//start();
}
private void dequeueLoop()
{
gprintln("Starting listener...");
/* Start accepting-and-enqueuing connections */
serverSocket.listen(0); /* TODO: Linux be lile, hehahahhahahah who gives one - I give zero */

View File

@ -54,7 +54,7 @@ public class DServer : Thread
this(DConfig config)
{
/* Set the function to be called on thread start */
super(&dequeueLoop);
super(&startListeners);
/* Set the server's config */
this.config = config;
@ -101,6 +101,18 @@ public class DServer : Thread
gprintln("Listener construction complete.");
}
/**
* Starts all the listeners
*/
private void startListeners()
{
foreach(DListener listener; listeners)
{
/* Start the listener */
listener.start();
}
}
public DConfig getConfig()
{
return config;
@ -143,7 +155,7 @@ public class DServer : Thread
/* Initialize the Meyer linking sub-system */
meyerSS = new DMeyer(this);
/* Start the connection dequeue thread */
/* Start the listener starter */
start();
}