diff options
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 0da5af7..230bd83 100644 --- a/test_msgnet/main.go +++ b/test_msgnet/main.go @@ -45,9 +45,9 @@ func msgHelloSerialize(name string, text string) salticidae.Msg { func msgHelloUnserialize(msg salticidae.Msg) MsgHello { p := msg.GetPayload() - length := binary.LittleEndian.Uint32(p.GetData(4)) - name := string(p.GetData(int(length))) - text := string(p.GetData(p.Size())) + length := binary.LittleEndian.Uint32(p.GetDataInPlace(4)) + name := string(p.GetDataInPlace(int(length))) + text := string(p.GetDataInPlace(p.Size())) p.Free() return MsgHello { name: name, text: text } } |