Availability::- use_module(library(socket)).(can be autoloaded)
tcp_bind(+Socket, ?Port)
Bind the socket to Port on the current machine. This operation, together with tcp_listen/2 and tcp_accept/3 implement the server-side of the socket interface. 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.