Order of construction details (WIP)

This commit is contained in:
Tristan B. Kildaire 2020-07-27 14:12:56 +02:00
parent c7398586ea
commit c23214b186
3 changed files with 10 additions and 4 deletions

View File

@ -27,8 +27,8 @@ void main()
ButterflyListener[] listeners = constructListeners(config["listeners"]);
/* Start the server */
Address address = parseAddress(config["address"].str(), to!(ushort)(config["port"].str()));
ButterflyServer server = new ButterflyServer(listeners, config["domain"].str());
//Address address = parseAddress(config["address"].str(), to!(ushort)(config["port"].str()));
ButterflyServer server = new ButterflyServer(listeners);
}
private ButterflyListener[] constructListeners(JSONValue listenersBlock)
@ -45,7 +45,7 @@ private ButterflyListener[] constructListeners(JSONValue listenersBlock)
{
writeln("Constructing listener \"" ~ listener ~ "\" ...");
writeln("Listener \"" ~ listener ~ "\"constructed");
}

View File

@ -9,6 +9,7 @@ public abstract class ButterflyListener : Thread
private ButterflyServer server;
private string listenerName;
private JSONValue config;
private string domain;
this(string listenerName, JSONValue config)
{
@ -32,6 +33,11 @@ public abstract class ButterflyListener : Thread
return listenerName;
}
public string getDomain()
{
return domain;
}
public JSONValue getConfig()
{
return config;

View File

@ -27,7 +27,7 @@ public final class ButterflyServer
/* TODO: Server domain */
public string domain;
this(ButterflyListener[] listeners, string domain)
this(ButterflyListener[] listeners)
{
/**
* Create the needed directories (if not already present)