mirror of
https://github.com/deavminet/libdnet.git
synced 2025-03-25 04:18:36 +00:00
Start tasky on connect() call, instantiate a new Tasky engine in the libdnet ctor
This commit is contained in:
parent
fdf8d0ba04
commit
3ca097152f
@ -4,7 +4,7 @@
|
|||||||
*/
|
*/
|
||||||
module libdnet.libdnet;
|
module libdnet.libdnet;
|
||||||
|
|
||||||
import std.socket : Address;
|
import std.socket : Address, Socket;
|
||||||
import tasky.engine : Engine;
|
import tasky.engine : Engine;
|
||||||
|
|
||||||
public class Client
|
public class Client
|
||||||
@ -31,6 +31,13 @@ public class Client
|
|||||||
/* TODO: Initialize stuff here */
|
/* TODO: Initialize stuff here */
|
||||||
|
|
||||||
this.endpoint = endpoint;
|
this.endpoint = endpoint;
|
||||||
|
|
||||||
|
/* Open socket here */
|
||||||
|
Socket sock = new Socket();
|
||||||
|
sock.connect(endpoint);
|
||||||
|
|
||||||
|
/* Initialize a new Tasky engine */
|
||||||
|
engine = new Engine(sock);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -39,13 +46,8 @@ public class Client
|
|||||||
*/
|
*/
|
||||||
public void connect()
|
public void connect()
|
||||||
{
|
{
|
||||||
/* FIXME: Don't start Tasky engine till we are actually connected (FIX in Tasky) */
|
|
||||||
|
|
||||||
/* Initialize a new Tasky engine */
|
|
||||||
//engine = new Engine();
|
|
||||||
|
|
||||||
/* Start the Tasky engine */
|
/* Start the Tasky engine */
|
||||||
//engine.start();
|
engine.start();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user