ntohs() and ntohl() equivalent?

bobber205 picture bobber205 · Mar 10, 2010 · Viewed 20.3k times · Source

Are there net to host conversion functions in C#? Googling and not finding much. :P

Answer

Jon Skeet picture Jon Skeet · Mar 10, 2010

IPAddress.HostToNetworkOrder and IPAddress.NetworkToHostOrder?

Each method has overloads for 16, 32 and 64 bit integers.