Isn’t .NET supposed to follow the host’s byte order?

I’m doing some socket programming with a little-endian protocol, namely Minecraft’s RCON protocol, relying heavily on BitConverter. I can’t get any response from the server, even though I know for a fact my logic is correct (I prototyped it in Python beforehand). I know that .NET is basically Microsoft’s Java clone, so I then looked up .NET’s byte order (thinking that it was big-endian), and the results I got said it followed the host architecture. Still nothing. Then I got a wild hair up my ass, dumped a packet to a file before sending it, and then inspected it in a hex editor. Sure enough, I’m sending big-endian integers.

Is this a bug? And if not, what’s swapping the byte order?

submitted by /u/pagefault0x16
[link] [comments]

Leave a Reply