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);
|
DataMessage tristanEncoded = new DataMessage(tag, data);
|
||||||
|
|
||||||
/* Then send it */
|
/* 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).
|
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;
|
return tag;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static byte[] encodeForSend(DataMessage message)
|
||||||
|
{
|
||||||
|
import bmessage;
|
||||||
|
|
||||||
|
return encodeBformat(message.encode());
|
||||||
}
|
}
|
|
@ -62,12 +62,6 @@ public final class Manager
|
||||||
return matchingQueue;
|
return matchingQueue;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void sendMessage(DataMessage message)
|
|
||||||
{
|
|
||||||
import bmessage;
|
|
||||||
sendMessage(socket, message);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* TODO: Probably remove this or keep it */
|
/* TODO: Probably remove this or keep it */
|
||||||
public bool isValidTag(ulong tag)
|
public bool isValidTag(ulong tag)
|
||||||
{
|
{
|
||||||
|
|
Binary file not shown.
Loading…
Reference in New Issue