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