aboutsummaryrefslogtreecommitdiff
path: root/test_msgnet
diff options
context:
space:
mode:
authorDeterminant <tederminant@gmail.com>2019-06-17 16:40:52 -0400
committerDeterminant <tederminant@gmail.com>2019-06-17 16:40:52 -0400
commit2378094c53f0fc8430bdd3137278e57b8fdf8df7 (patch)
treebf9d1c329c446406f2976d937024c3110b5c8b17 /test_msgnet
parent1da641f46b49d3d9a92351f8309f4881dfbf2dc2 (diff)
finish doc
Diffstat (limited to 'test_msgnet')
-rw-r--r--test_msgnet/main.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/test_msgnet/main.go b/test_msgnet/main.go
index 4e52982..9509c2e 100644
--- a/test_msgnet/main.go
+++ b/test_msgnet/main.go
@@ -34,10 +34,10 @@ func msgHelloSerialize(name string, text string) salticidae.Msg {
}
func msgHelloUnserialize(msg salticidae.Msg) (name string, text string) {
- p := msg.ConsumePayload()
- length := binary.LittleEndian.Uint32(p.GetDataInPlace(4))
- name = string(p.GetDataInPlace(int(length)))
- text = string(p.GetDataInPlace(p.Size()))
+ p := msg.GetPayloadByMove()
+ t := p.GetDataInPlace(4); length := binary.LittleEndian.Uint32(t.Get()); t.Release()
+ t = p.GetDataInPlace(int(length)); name = string(t.Get()); t.Release()
+ t = p.GetDataInPlace(p.Size()); text = string(t.Get()); t.Release()
return
}