It is also possible to use
bind() on the client side to associate a socket with a particular address and port. It is sometimes useful to use
bind() in this manner on machines that have multiple network interfaces. The use of
bind() can allow the selection of which network address to use for the outgoing connection.
bind() is used to set the local port for an outgoing connection. This is usually a bad idea for a few reasons. First, it very seldom serves any purpose. The port number presented to the connected server is likely to be different because of network address translation regardless. Binding to a local port also invites the error of selecting a port that is already in use. Usually, the operating system takes care of selecting a free port. This use of