diff options
author | Determinant <[email protected]> | 2019-06-30 18:35:20 -0400 |
---|---|---|
committer | Determinant <[email protected]> | 2019-06-30 18:35:20 -0400 |
commit | bbe214128b6f7cb4e57fcda7adc3205ec9ec66cb (patch) | |
tree | 67563de5f0ab2bd9cef29e5ed7efb25398f6219c /test_msgnet | |
parent | d247c437f396709f62eadaf863b8a552d7142fc7 (diff) |
allow manual memory management for types frequently used in messaging
Diffstat (limited to 'test_msgnet')
-rw-r--r-- | test_msgnet/main.go | 6 |
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) { |