Added `sendMessage` to bformat encode the final t-encoded message

This commit is contained in:
Tristan B. Velloza Kildaire 2021-09-08 20:45:39 +02:00
parent ce3772c66c
commit b060b30c44
2 changed files with 9 additions and 0 deletions

View File

@ -50,6 +50,9 @@ byte[] data = cast(byte[])"Hello";
/* When sending a message */
DataMessage tristanEncoded = new DataMessage(tag, data);
/* Then send it */
manager.sendMessage(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).

View File

@ -62,6 +62,12 @@ 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)
{