text: Technical Support
  On-Line Manuals
  RL-ARM User's Guide (MDK v4)
  #include <rtl.h>
  int sendto (
  int sock, /* Socket descriptor */
  const char *buf, /* Pointer to a buffer with data */
  int len, /* Length of data in bytes */
  int flags, /* Message flags */
  SOCKADDR *to, /* Pointer to destination address */
  int tolen); /* Length of the address structure */
  The sendto function is used to send data on a
  SOCK_DGRAM socket type. argument to is a pointer to the SOCKADDR structure that
  contains the end point node IP address and port number.
  The argument tolen specifies the length of SOCKADDR
  structure.
  The sendto function is in the RL-TCPnet library. The
  prototype is defined in rtl.h.
  note
  The send function returns the result code:
  ioctlsocket, recv, recvfrom, send
  #include <rtl.h>
  __task void client (void) {
  /* LED Control client task. */
  SOCKADDR_IN to;
  int sock, res;
  char dbuf[4];
  U8 p2val,lshf;
  while (1) {
  sock = socket (AF_INET, SOCK_DGRAM, 0);
  to.sin_port = htons(1001);
  to.sin_family = PF_INET;
  to.sin_addr.s_b1 = 192;
  to.sin_addr.s_b2 = 168;
  to.sin_addr.s_b3 = 0;
  to.sin_addr.s_b4 = 100;to (sock, (char *)&dbuf, 2, 0, (SOCKADDR *)&to, sizeof (to));
  if (res < 0) {
  break;
  }
  os_dly_wait (50);
  }
  closesocket .