aboutsummaryrefslogtreecommitdiff
path: root/test_msgnet
diff options
context:
space:
mode:
authorDeterminant <[email protected]>2019-06-30 18:35:20 -0400
committerDeterminant <[email protected]>2019-06-30 18:35:20 -0400
commitbbe214128b6f7cb4e57fcda7adc3205ec9ec66cb (patch)
tree67563de5f0ab2bd9cef29e5ed7efb25398f6219c /test_msgnet
parentd247c437f396709f62eadaf863b8a552d7142fc7 (diff)
allow manual memory management for types frequently used in messaging
Diffstat (limited to 'test_msgnet')
-rw-r--r--test_msgnet/main.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/test_msgnet/main.go b/test_msgnet/main.go
index 292fb8f..5b31c2c 100644
--- a/test_msgnet/main.go
+++ b/test_msgnet/main.go
@@ -23,12 +23,12 @@ const (
)
func msgHelloSerialize(name string, text string) salticidae.Msg {
- serialized := salticidae.NewDataStream()
+ serialized := salticidae.NewDataStream(true)
serialized.PutU32(salticidae.ToLittleEndianU32(uint32(len(name))))
serialized.PutData([]byte(name))
serialized.PutData([]byte(text))
return salticidae.NewMsgMovedFromByteArray(
- MSG_OPCODE_HELLO, salticidae.NewByteArrayMovedFromDataStream(serialized))
+ MSG_OPCODE_HELLO, salticidae.NewByteArrayMovedFromDataStream(serialized, true), true)
}
func msgHelloUnserialize(msg salticidae.Msg) (name string, text string) {
@@ -41,7 +41,7 @@ func msgHelloUnserialize(msg salticidae.Msg) (name string, text string) {
}
func msgAckSerialize() salticidae.Msg {
- return salticidae.NewMsgMovedFromByteArray(MSG_OPCODE_ACK, salticidae.NewByteArray())
+ return salticidae.NewMsgMovedFromByteArray(MSG_OPCODE_ACK, salticidae.NewByteArray(true), true)
}
func checkError(err *salticidae.Error) {