| Binds the socket to the specified IP and port |
| Declaration: |
| function bind(string host, number port) |
| Description: |
| This function binds the socket to a specific IP and port (although the IP can be Network.ANY which means "listen to every IP address on the machine"). You do not need to listen() or accept() like TCP sockets. If the address family is Network.AF_IPV4, bind will look for an IPV4 address with that name and fail if it doesn't find one. If it is Network.AF_IPV6, it will look for an IPV6 address and fail if it doesn't find one. If it is Network.AF_AUTO, it will try to find an IPV6 address, then try to find an IPV4 address, and only fail if it doesn't find either. Note: you can leave off the af parameter if you wish, and it will default to Network.AF_AUTO. |
| Parameters: |
| Parameter #1: string host - The hostname or IP to listen on, or Network.ANY |
| Parameter #2: number port - The port number to listen on |
| Parameter #3: number af - The address family to use |