Should htons be used on all data recieved by a winsock?
Printable View
Should htons be used on all data recieved by a winsock?
no, it should not.
htons shouldn't be used on any data received over a network it should be used on data sent over a network and then only when the remote peer expects it. ntohs is used on received data.
I see, could you possibly help with this problem?
http://cboard.cprogramming.com/showthread.php?t=63162