mirror of
http://deavmi.assigned.network/git/deavmi/tristanable
synced 2025-02-19 22:36:49 +00:00
Changed API
This commit is contained in:
parent
b060b30c44
commit
e5a0a280bc
@ -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).
|
||||
|
@ -57,4 +57,11 @@ public final class DataMessage
|
||||
{
|
||||
return tag;
|
||||
}
|
||||
}
|
||||
|
||||
public static byte[] encodeForSend(DataMessage message)
|
||||
{
|
||||
import bmessage;
|
||||
|
||||
return encodeBformat(message.encode());
|
||||
}
|
@ -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)
|
||||
{
|
||||
|
BIN
tristanable-test-library
Executable file
BIN
tristanable-test-library
Executable file
Binary file not shown.
Loading…
Reference in New Issue
Block a user