From 8df01992ce0eae54ee2b81222b8d4b4893e72e62 Mon Sep 17 00:00:00 2001 From: "Tristan B. Kildaire" Date: Sun, 19 Apr 2020 13:11:49 +0200 Subject: [PATCH] WIP --- built_in_handlers.md | 14 ++++++++++++++ source/server/handler.d | 2 +- source/server/server.d | 2 +- 3 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 built_in_handlers.md diff --git a/built_in_handlers.md b/built_in_handlers.md new file mode 100644 index 0000000..889cb27 --- /dev/null +++ b/built_in_handlers.md @@ -0,0 +1,14 @@ +Built-in handlers +================= + +There is a built-in handler for when the `type` field is set +to `internal`. + +The `data` field of the `payload` JSON object will be of the +form: + +```` +"data" : { + +} +```` \ No newline at end of file diff --git a/source/server/handler.d b/source/server/handler.d index d501fb0..2455b85 100644 --- a/source/server/handler.d +++ b/source/server/handler.d @@ -41,7 +41,7 @@ public class MessageHandler domainSocket = new Socket(AddressFamily.UNIX, SocketType.STREAM); /* Bind it to the socket path */ - domainSocket.connect(new UnixAddress(socketPath)); + domainSocket.connect(new UnixAddressx(socketPath)); } private static string[] getAvailableTypes(JSONValue handlerBlock) diff --git a/source/server/server.d b/source/server/server.d index 1c4acb8..285e50d 100644 --- a/source/server/server.d +++ b/source/server/server.d @@ -4,7 +4,7 @@ import server.types; import std.conv : to; import std.socket : SocketOSException; import utils.debugging : debugPrint; -import std.stdio : File, writeln; +import std.stdio : File,; import std.json : parseJSON, JSONValue; JSONValue getConfig(string configurationFilePath)