BSD Socket Network Programming API creates socket object
int socket (int __domain, int __type, int __protocol) : Successfully returns the socket file descriptor, failure returns-1.
Parameter 1:socket the address cluster or protocol family used by the object
Commonly used are pf_local (native communication), Pf_inet (IPV4 protocol cluster), PF_INET6 (IPV6 protocol cluster)
The type of the parameter 2:socket. Common: connection-oriented data flow mode; Non-connected datagram mode
Parameter 3: Identifies which protocol to use, and 0 indicates default.
Bind the IP address to the port
int bind (int __fd, __const_sockaddr_arg __addr, socklen_t __len) : Successfully returned 0, failed return-1
Parameter 1: File descriptor for binding to the ground IP
Parameter 2: Pointer to SOCKADDR structure, identifying local address information
"Linux Advanced Programming" (13th) Linux Socket Network Programming Fundamentals 2