#network byte order
1 messages · Page 1 of 1 (latest)
so self.csum.len is 22?
Yes
you could inspect len_bytes on the zig side to narrow this down, i guess it should be .{ 0x00, 0x16 }
hm
it definitely seems correct to use both std.mem.writeInt with .big in zig, and ntohs in C
i wonder if maybe in either the server or the client you're accidentally byte swapping it twice?
or inadvertently shifting it by reading from the wrong offset, like if the stream is { 0, 16, 0 } it could look like { 0, 16 } or { 16, 0 }