#include <rtl.h>
BOOL udp_send (
U8 socket, /* UDP socket to send the data packet from. */
U8* remip, /* Pointer to the IP address of the remote machine. */
U16 remport, /* Port number of remote machine to send the data to. */
U8* buf, /* Pointer to buffer containing the data to send. */
U16 dlen ); /* Number of bytes of data to send. */
Description
The udp_send function sends the data packet to a remote
machine. The argument socket specifies the socket handle to
use for communication on the local machine.
The argument remip points to a buffer containing the four
octets that make up the ip address of the remote machine. The
argument remport specifies the port on the remote machine to
send the data packet to.
The argument buf points to the constructed UDP data packet.
The argument dlen specifies the number of bytes in the data
packet to send.
The udp_send function is in the RL-TCPnet library. The
prototype is defined in rtl.h.
note
You must allocate the memory using udp_get_buf before
calling udp_send.
The socket must already be open for communication before you
can send data.
The same UDP socket, using the same local port, can communicate
with several remote machines using UDP ports. The user application
must handle proper multiplexing of outgoing packets and
demultiplexing of received packets.
Return Value
The udp_send function returns __TRUE when the UDP packet
has been sent successfully. Otherwise, the function returns
__FALSE.
Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers of your data.