 [det]tcp_bind(SocketId, 
?Address)Bind the socket to Address on the current machine. This 
operation, together with tcp_listen/2 
and tcp_accept/3 implement the server-side 
of the socket interface. Address is either an plain Port 
or a term HostPort. The first form binds the socket to the given port on 
all interfaces, while the second only binds to the matching interface. A 
typical example is below, causing the socket to listen only on port 8080 
on the local machine's network.
[det]tcp_bind(SocketId, 
?Address)Bind the socket to Address on the current machine. This 
operation, together with tcp_listen/2 
and tcp_accept/3 implement the server-side 
of the socket interface. Address is either an plain Port 
or a term HostPort. The first form binds the socket to the given port on 
all interfaces, while the second only binds to the matching interface. A 
typical example is below, causing the socket to listen only on port 8080 
on the local machine's network.
  tcp_bind(Socket, localhost:8080)
If Port is unbound, the system picks an arbitrary free 
port and unifies Port with the selected port number. Port 
is either an integer or the name of a registered service. See also
tcp_connect/4.