| Create a socket bound to a TCP port |
| Declaration: |
| native function tcp_bind(string host, number port, number af) |
| Description: |
| This function attempts to create a TCP socket bound to the specified address and port, and if it succeeds, returns a Sys.TcpStream object. The address to bind to can be Network.ANY4 to bind to every IPV4 address or Network.ANY6 to bind to every IPV6 address. 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 address to bind to |
| Parameter #2: number port - The port to listen on, use 0 for any port |
| Parameter #3: number af - The address family to use |
| Returns: |
| An object that can accept connections, or null on error. |