Adding tests

This commit is contained in:
Tristan B. Kildaire 2020-06-23 12:11:31 +02:00
parent 46c6c065d0
commit 0a7dda74a0
9 changed files with 85 additions and 2 deletions

View File

15
example/client/.gitignore vendored Normal file
View File

@ -0,0 +1,15 @@
.dub
docs.json
__dummy.html
docs/
/example
example.so
example.dylib
example.dll
example.a
example.lib
example-test-*
*.exe
*.o
*.obj
*.lst

12
example/client/dub.json Normal file
View File

@ -0,0 +1,12 @@
{
"authors": [
"Tristan B. Kildaire"
],
"copyright": "Copyright © 2020, Tristan B. Kildaire",
"dependencies": {
"tristanable": "~>0.0.10"
},
"description": "A minimal D application.",
"license": "proprietary",
"name": "example"
}

View File

@ -0,0 +1,7 @@
{
"fileVersion": 1,
"versions": {
"bformat": "1.0.8",
"tristanable": "0.0.10"
}
}

View File

@ -0,0 +1,11 @@
import std.stdio;
import tristanable.manager : Manager;
import std.socket;
void main()
{
writeln("Edit source/app.d to start your project.");
Socket socket = new Socket(AddressFamily.INET, SocketType.STREAM, ProtocolType.TCP);
socket.connect(parseAddress("127.0.0.1",7777));
Manager manager = new Manager(socket);
}

15
example/server/.gitignore vendored Normal file
View File

@ -0,0 +1,15 @@
.dub
docs.json
__dummy.html
docs/
/server
server.so
server.dylib
server.dll
server.a
server.lib
server-test-*
*.exe
*.o
*.obj
*.lst

9
example/server/dub.json Normal file
View File

@ -0,0 +1,9 @@
{
"authors": [
"Tristan B. Kildaire"
],
"copyright": "Copyright © 2020, Tristan B. Kildaire",
"description": "A minimal D application.",
"license": "proprietary",
"name": "server"
}

View File

@ -0,0 +1,14 @@
import std.stdio;
import std.socket;
void main()
{
writeln("Edit source/app.d to start your project.");
Socket socket = new Socket(AddressFamily.INET, SocketType.STREAM, ProtocolType.TCP);
socket.bind(parseAddress("127.0.0.1",7777));
socket.listen(1);
while(true)
{
socket.accept();
}
}

View File

@ -47,7 +47,7 @@ public final class Manager
watcher = new Watcher(this, endpoint);
/* Create the garbage collector */
gc = new GarbageCollector(this);
//gc = new GarbageCollector(this);
/* Initialize the `requestQueue` mutex */
queueMutex = new Mutex();
@ -56,7 +56,7 @@ public final class Manager
watcher.start();
/* Start the garbage collector */
gc.start();
//gc.start();
}
public void sendMessage(ulong tag, byte[] data)