Big endian or Little endian on net?

后端 未结 3 461
粉色の甜心
粉色の甜心 2021-02-04 02:59

In what byte order does data transfer occur on net? Is it Little Endian or big endian? How is it converted to the respective byte order once the data reaches the host ?

3条回答
  •  旧巷少年郎
    2021-02-04 03:39

    if you are using tcp using htons((short)port) enables you to use network safe protocol(basically big endian) and dont care about little vs. big endian.

    if you do need to convert use http://www.codeguru.com/forum/showthread.php?t=292902

    Its explained well

提交回复
热议问题