what is the difference between bind and connect?
bind() causes the socket to listen for incoming requests on a particular interface/port. ... Only one socket can bind a port. connect() causes the socket to make a connection to an address/port serviced by a different socket. In other words, it's used by clients to connect to a server.