Obsolete
/
libipc-old
Archived
3
0
Fork 0

Receive msg example: fixing buffer offset.

master
Philippe Pittoli 2022-12-21 19:26:03 +01:00
parent a39ce64b7b
commit 0e2043c5e6
1 changed files with 1 additions and 1 deletions

View File

@ -35,7 +35,7 @@ fn receive_msg(stream: net.Stream) !void {
const msg_type = try reader.readByte(); const msg_type = try reader.readByte();
const msg_len = try reader.readIntBig(u32); const msg_len = try reader.readIntBig(u32);
const msg_payload = buffer[4..size]; const msg_payload = buffer[5..5+msg_len];
print ("type: {}, len {}, content: {s}\n" print ("type: {}, len {}, content: {s}\n"
, .{msg_type, msg_len, msg_payload}); , .{msg_type, msg_len, msg_payload});
} }