Sends a datagram to the specified UDP host/port. |
Declaration: |
native function sendTo(string host, number port, number af, string dgram) |
Description: |
This function sends a UDP datagram to the specified port at the specified host. Returns false and sets err.str on failure. 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. |
Parameters: |
Parameter #1: string host - The hostname or IP of the destination |
Parameter #2: number port - The destination port number |
Parameter #3: number af - The address family to use |
Parameter #4: string dgram - The datagram to send |