Sockets need to be bundled on the address to be useful!
Identify the target process to have 1. The other computer's computer network address IP 2. Port number shows the specific process of the other machine
The sequence of bytes is the meaning of the order of bytes.
Detailed explanation can see this http://www.ruanyifeng.com/blog/2016/11/byte-order.html
Since network transport is the byte order of the specified big end, it is possible to transform the data in a small-endian environment.
These 4 functions are helpful:
#include <arpa/inet.h>
uint32_t htonl (unit32_t hostinit32); Represented by network byte order
unit16_t htons (unit16_t hostint16);
unit32_t Ntohl (unit32_t netint32); Represented by host byte order
unit16_t Ntohs (unit16_t netint16);
The address formats of different domains are different, so the addresses will be uniformly converted to the common address structure sockaddr!
Linux sockets socket and addressing