i was thinking, the htons function converts a small endian value to a big endian value, well, intel have an opcode which does exactly the same thing (as ar as i can tell it does) bswap i.e: 31-24|23-16|15-08|07-00 ^ ^ ^ ^ \ \___/ / \____swap_____/ sorry, thats not very clear, byte the highest byte is swaped with the lowest, and the two middle bytes are exchanged. the only problem with bswap is it is 486+, but i dont know if that is gonna be much of a problem now.
Well most of us winsock programmers aren't too conserned with speed when translating IP addresses, and would rather be 100% compatable to ensure good operating code. Now does not the byte order also change between big endian and little endian? I don't remember, but I thought it did. - Ben