diff --git a/README.md b/README.md index ab685fc..1996ce6 100644 --- a/README.md +++ b/README.md @@ -52,7 +52,7 @@ byte[] data = cast(byte[])"Hello"; DataMessage tristanEncoded = new DataMessage(tag, data); /* Then send it */ -manager.sendMessage(tristanEncoded); +socket.send(encodeForSend(tristanEncoded)); ``` And let tristanable handle it! We even handle the message lengths and everything using another great project [bformat](http://deavmi.assigned.network/projects/bformat). diff --git a/source/tristanable/encoding.d b/source/tristanable/encoding.d index bc88d96..c28bae4 100644 --- a/source/tristanable/encoding.d +++ b/source/tristanable/encoding.d @@ -57,4 +57,11 @@ public final class DataMessage { return tag; } +} + +public static byte[] encodeForSend(DataMessage message) +{ + import bmessage; + + return encodeBformat(message.encode()); } \ No newline at end of file diff --git a/source/tristanable/manager.d b/source/tristanable/manager.d index f4d030c..c9803e0 100644 --- a/source/tristanable/manager.d +++ b/source/tristanable/manager.d @@ -62,12 +62,6 @@ public final class Manager return matchingQueue; } - public void sendMessage(DataMessage message) - { - import bmessage; - sendMessage(socket, message); - } - /* TODO: Probably remove this or keep it */ public bool isValidTag(ulong tag) { diff --git a/tristanable-test-library b/tristanable-test-library new file mode 100755 index 0000000..0f0ba67 Binary files /dev/null and b/tristanable-test-library differ