mirror of https://github.com/deavminet/libdnet.git
WIP: Moving over to queue_sys for tristsnabale
This commit is contained in:
parent
48e3e261bf
commit
d110c95d12
|
@ -1,6 +1,7 @@
|
||||||
module libdnet.dclient;
|
module libdnet.dclient;
|
||||||
|
|
||||||
import tristanable.manager : Manager;
|
import tristanable.manager : Manager;
|
||||||
|
import tristanable.queue : Queue;
|
||||||
import std.socket;
|
import std.socket;
|
||||||
import std.stdio;
|
import std.stdio;
|
||||||
import std.conv : to;
|
import std.conv : to;
|
||||||
|
@ -29,13 +30,28 @@ public final class DClient
|
||||||
this(Address address)
|
this(Address address)
|
||||||
{
|
{
|
||||||
/* Initialize the socket */
|
/* Initialize the socket */
|
||||||
|
/* TODO: Error handling */
|
||||||
Socket socket = new Socket(address.addressFamily, SocketType.STREAM, ProtocolType.TCP);
|
Socket socket = new Socket(address.addressFamily, SocketType.STREAM, ProtocolType.TCP);
|
||||||
socket.connect(address);
|
socket.connect(address);
|
||||||
|
|
||||||
|
/* Initialize tristanable */
|
||||||
|
initTristanable(socket);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void initTristanable(Socket socket)
|
||||||
|
{
|
||||||
/* Initialize the manager */
|
/* Initialize the manager */
|
||||||
manager = new Manager(socket);
|
manager = new Manager(socket);
|
||||||
|
|
||||||
|
/* Create a queue for normal traffic (request-reply) */
|
||||||
|
Queue reqRepQueue = new Queue(0);
|
||||||
|
|
||||||
|
/* Create a queue for notifications (replies-only) */
|
||||||
|
Queue notificationQueue = new Queue(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Authenticates as a client with the server
|
* Authenticates as a client with the server
|
||||||
*
|
*
|
||||||
|
|
Loading…
Reference in New Issue