1
0
Fork 0
mirror of https://github.com/besterprotocol/besterd synced 2023-12-13 21:00:32 +01:00

Adding message handling backend

This commit is contained in:
Tristan B. Kildaire 2020-04-17 13:46:54 +02:00
parent 5d66832035
commit 29b01525a1

View file

@ -10,6 +10,12 @@ import std.string;
public class BesterServer
{
/**
* Message handlers
*
* Associative array of `payloadType (string)`:`MessageHandler`
* TODO: Implement this
*/
/* The server's socket */
private Socket serverSocket;
@ -20,6 +26,13 @@ public class BesterServer
initialize(bindAddress, listenPort);
}
private void loadHandlers(JSONValue handlerBlock)
{
/* TODO: Implement me */
}
private void initialize(string bindAddress, ushort listenPort)
{
/* Create a socket */
@ -135,8 +148,9 @@ private class BesterConnection : Thread
{
/* TODO: Implement me */
debugPrint("Dispatching payload [" ~ payloadType ~ "]");
debugPrint("Payload: " ~ payload.toPrettyString());
/* TODO: Lookup the payloadType handler */
/* TODO: Set return value */
return true;