1. Problem: the gateway parsing is correct. The reason for my. Net parsing error is that it was originally unsigned and I made it signed.
3. Word: unsigned double byte shaping
5. 0x800a to 32758
The reason is: the following two writing methods are equivalent. IPAddress. Networktohostorder() can’t receive uint16 type, so bitconverter.touint16 (arr, 0) is forced to be converted into int32 for reordering.
6. Write method 1: after “network sequence to host sequence”, take the absolute value, otherwise there will be problems. Write method 1 also has problems, so it’s better not to use it
As it turns out, there are problems in writing
7. Write method 2: “network sequence to host sequence”, and then convert to uint16 unsigned double byte shaping
Principle: int16 has more ffff than uint16 on the left, so this should be the symbol
The above is the whole content of this article. I hope it will help you in your study, and I hope you can support developepaer more.