bind(2) - Linux manual page

A complete tutorial on how to create socket, bind, connect The advantage to explicitly binding the socket yourself is the ability to choose a specific port from the entire range of available ports, which will be discussed in more detail in the next chapter. The most common cause of exceptions when calling the Bind() method is when a socket of the same protocol is already bound to the requested port. The bind() API call int bind(int socket_descriptor, struct sockaddr *local_address, int address_length); The procedure is called 'bind'. It takes 3 parameters, an integer, a pointer to a sockaddr structure, and another integer. The API also returns an integer. So, we'll add the following prototype to our SOCKET_H /copy member: What is the difference in these two methods : Socket.bind

The bind () function binds a unique local name to the socket with descriptor socket. After calling socket (), a descriptor does not have a name associated with it. However, it does belong to a particular address family as specified when socket () is called. The exact format of a name depends on the address family.

Socket Programming in Python - GeeksforGeeks

Berkeley sockets - Wikipedia

Binding a socket to an endpoint - Boost.Asio C++ Network Jan 25, 2016