mirror of
https://github.com/deavminet/dnetd
synced 2024-09-21 09:43:37 +02:00
Set the worker thread for outbound server links
This commit is contained in:
parent
611d9a1cc2
commit
d8f66aa271
10
source/app.d
10
source/app.d
@ -5,6 +5,7 @@ import dnetd.dconfig : DConfig, DLinkConfig;
|
||||
import std.json;
|
||||
import std.exception;
|
||||
import gogga;
|
||||
import dnetd.dlink : DLink, DMeyer;
|
||||
|
||||
void main(string[] args)
|
||||
{
|
||||
@ -76,14 +77,17 @@ void main(string[] args)
|
||||
/* Now configure the the linking */
|
||||
DLinkConfig linkConfig = DLinkConfig.getConfig(dserver, json["links"]);
|
||||
|
||||
/* TODO: COnfigure here */
|
||||
/* Get all server links */
|
||||
DLink[] serverLinks = linkConfig.getLinks();
|
||||
|
||||
/* Create a new Meyer */
|
||||
|
||||
|
||||
/* TODO: Start meyer here (remove from inside DServer) */
|
||||
/* Attach the Meyer to the server */
|
||||
|
||||
|
||||
|
||||
/* Start the server */
|
||||
/* Start the server (TODO: This should start Meyer) */
|
||||
dserver.startServer();
|
||||
}
|
||||
else
|
||||
|
@ -135,7 +135,6 @@ public final class DLinkConfig
|
||||
{
|
||||
/* Server links */
|
||||
private DLink[] links;
|
||||
private Address[] addresses;
|
||||
|
||||
public static DLinkConfig getConfig(DServer dserver, JSONValue linksBlock)
|
||||
{
|
||||
@ -170,7 +169,11 @@ public final class DLinkConfig
|
||||
dlinkConfig.links ~= new DLink(server, name, parseAddress(address, port));
|
||||
}
|
||||
|
||||
|
||||
return dlinkConfig;
|
||||
}
|
||||
|
||||
public DLink[] getLinks()
|
||||
{
|
||||
return links;
|
||||
}
|
||||
}
|
@ -60,6 +60,9 @@ public final class DLink : Thread
|
||||
*/
|
||||
this(DServer server, string name, Address address)
|
||||
{
|
||||
/* Set the worker thread for outbound connections */
|
||||
super(&outboundWorker);
|
||||
|
||||
/* Create an outbound connection */
|
||||
/* TODO: Fuuuuuuuuuuuuuuuuuuuck handling of shit here bababooey and not in dconnection.d as we would have done below */
|
||||
|
||||
@ -76,6 +79,12 @@ public final class DLink : Thread
|
||||
// connection = new DConnection();
|
||||
}
|
||||
|
||||
private void outboundWorker()
|
||||
{
|
||||
/* TODO: Implement me */
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Constructs a DLink for an inbound peering
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user