mirror of https://github.com/deavminet/dnetd.git
The dserver now starts all constructed listeners
This commit is contained in:
parent
9e3da7d09f
commit
917402e974
|
@ -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 */
|
||||
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue