From 1371ede9aad86dce624f4486b5d7831aa6de5a70 Mon Sep 17 00:00:00 2001 From: Determinant Date: Tue, 11 Jun 2019 19:28:12 -0400 Subject: finish the stress test --- test_msgnet/main.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'test_msgnet') diff --git a/test_msgnet/main.go b/test_msgnet/main.go index 230bd83..1ebdc74 100644 --- a/test_msgnet/main.go +++ b/test_msgnet/main.go @@ -38,13 +38,13 @@ func msgHelloSerialize(name string, text string) salticidae.Msg { serialized.PutData(t) serialized.PutData([]byte(name)) serialized.PutData([]byte(text)) - return salticidae.NewMsg( + return salticidae.NewMsgMovedFromByteArray( MSG_OPCODE_HELLO, salticidae.NewByteArrayMovedFromDataStream(serialized)) } func msgHelloUnserialize(msg salticidae.Msg) MsgHello { - p := msg.GetPayload() + p := msg.ConsumePayload() length := binary.LittleEndian.Uint32(p.GetDataInPlace(4)) name := string(p.GetDataInPlace(int(length))) text := string(p.GetDataInPlace(p.Size())) @@ -53,7 +53,7 @@ func msgHelloUnserialize(msg salticidae.Msg) MsgHello { } func msgAckSerialize() salticidae.Msg { - return salticidae.NewMsg(MSG_OPCODE_ACK, salticidae.NewByteArray()) + return salticidae.NewMsgMovedFromByteArray(MSG_OPCODE_ACK, salticidae.NewByteArray()) } type MyNet struct { -- cgit v1.2.3-70-g09d2