This function associates a socket to a local address. If no IP address is specified, the socket will bind to all interfaces (in the case of a LISTEN SOCKET command) or force the choice a specific out-going interface (in the case of CONNECT SOCKET).
If this command is not used on a socket, then the windows socket system will choose a free port number - this is usually desired for a connecting socket, but not for a listening socket.
This function must be used on a socket before the socket is used for any purpose - if this is not done then the bind will fail.
Returns 1 for connection successful, or 0 for a failure |