Sends a UDP datagram to the specified IP address and port.
Takes a handle (Int), IP address (String), port (Int), buffer pointer (Int), and size (Int).
Returns the number of bytes sent, or -1 on error (Int).
Network
Parameters & Returns
Parameters
handleInt
ipString
portInt
bufferInt
sizeInt
Returns
Int
Quick Summary
Sends a UDP datagram to the specified IP address and port.
Takes a handle (Int), IP address (String), port (Int), buffer pointer (Int), and size (Int).
Returns the number of bytes sent, or -1 on error (Int).
Technical Exegesis...
Sends 'size' bytes from the buffer as a UDP datagram to the specified IP and port. Returns the number of bytes sent, or -1 on error (SOCKET_ERROR). Returns 0 if any parameter is invalid (NULL ip, NULL buffer, size <= 0, port <= 0, or invalid handle).
Uses sendto with the socket handle. IP should be in dotted notation (e.g., "192.168.1.100"). UDP is unreliable and unordered - datagrams may be lost, duplicated, or arrive out of order. No connection needed.
Sends 'size' bytes from the buffer as a UDP datagram to the specified IP and port. Returns the number of bytes sent, or -1 on error (SOCKET_ERROR). Returns 0 if any parameter is invalid (NULL ip, NULL buffer, size <= 0, port <= 0, or invalid handle).
Uses sendto with the socket handle. IP should be in dotted notation (e.g., "192.168.1.100"). UDP is unreliable and unordered - datagrams may be lost, duplicated, or arrive out of order. No connection needed. Useful for fast, lightweight messaging and broadcasting.