From 2378094c53f0fc8430bdd3137278e57b8fdf8df7 Mon Sep 17 00:00:00 2001 From: Determinant Date: Mon, 17 Jun 2019 16:40:52 -0400 Subject: finish doc --- test_msgnet/main.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'test_msgnet') 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 } -- cgit v1.2.3-70-g09d2