title: Getting response in simple_udp_connection
body: <p>I have a code in contiki cooja. I have 2 sending nodes and 2 receiving nodes as you can see in the picture<a href="http://i.stack.imgur.com/Ch0F3.jpg" rel="nofollow">1</a>. the broadcast senders and receivers are as follows.</p>
  
  <pre><code>#include "contiki.h"
  #include "lib/random.h"
  #include "sys/etimer.h"
  #include "net/ip/uip.h"
  #include "net/ipv6/uip-ds6.h"
  #include "net/ip/uip-debug.h"
  
  
  #include "simple-udp.h"
  
  
  #include &lt;stdio.h&gt;
  #include &lt;string.h&gt;
  
  
  
  #define SEND_INTERVAL       (20 * CLOCK_SECOND)
  #define SEND_TIME       (random_rand() % (SEND_INTERVAL))
  
  static struct simple_udp_connection broadcast_connection;
  
  
  /*---------------------------------------------------------------------------*/
  PROCESS(broadcast_example_process, "UDP broadcast example process");
  AUTOSTART_PROCESSES(&amp;broadcast_example_process);
  /*---------------------------------------------------------------------------*/
  static void
  receiver(struct simple_udp_connection *c,
           const uip_ipaddr_t *sender_addr,
           uint16_t sender_port,
           const uip_ipaddr_t *receiver_addr,
           uint16_t receiver_port,
           const uint8_t *data,
           uint16_t datalen)
  {
   printf("Data received from ");
    uip_debug_ipaddr_print(sender_addr);
    printf(" on port %d from port %d with length %d:  %s \n",
           receiver_port, sender_port, datalen, data);
  
  }
  /*---------------------------------------------------------------------------*/
  
  PROCESS_THREAD(broadcast_example_process, ev, data)
  {
  
  
  
    static struct etimer periodic_timer;
    static struct etimer send_timer;
    uip_ipaddr_t addr;
    char message[20];
    sprintf(message," hello ");
  
    PROCESS_BEGIN();
  
    simple_udp_register(&amp;broadcast_connection, 1234,
                        NULL, 1900,
                        receiver);
    etimer_set(&amp;periodic_timer, SEND_INTERVAL);
    while(1) {
  
  
  
      PROCESS_WAIT_EVENT_UNTIL(etimer_expired(&amp;periodic_timer));
      etimer_reset(&amp;periodic_timer);
      etimer_set(&amp;send_timer, SEND_TIME);
  
      PROCESS_WAIT_EVENT_UNTIL(etimer_expired(&amp;send_timer));
  
      printf("Sending broadcast\n");
      uip_create_linklocal_allnodes_mcast(&amp;addr);
      simple_udp_sendto(&amp;broadcast_connection, message , strlen(message) , &amp;addr);
  
    }
  
    PROCESS_END();
  }
  /*---------------------------------------------------------------------------*/
  </code></pre>
  
  <p>and receivers:</p>
  
  <pre><code>#include "contiki.h"
  #include "lib/random.h"
  #include "sys/ctimer.h"
  #include "sys/etimer.h"
  #include "net/ip/uip.h"
  #include "net/ipv6/uip-ds6.h"
  
  #include "simple-udp.h"
  #include "net/ip/uip-debug.h"
  
  #include &lt;stdio.h&gt;
  #include &lt;string.h&gt;
  
  #define UDP_PORT 1900
  
  
  
  static struct simple_udp_connection broadcast_connection;
  
  
  /*---------------------------------------------------------------------------*/
  PROCESS(broadcast_example_process, "UDP broadcast example process");
  AUTOSTART_PROCESSES(&amp;broadcast_example_process);
  /*---------------------------------------------------------------------------*/
  static void
  receiver(struct simple_udp_connection *c,
           const uip_ipaddr_t *sender_addr,
           uint16_t sender_port,
           const uip_ipaddr_t *receiver_addr,
           uint16_t receiver_port,
           const uint8_t *data,
           uint16_t datalen)
  {
    printf("Data received from ");
    uip_debug_ipaddr_print(sender_addr);
    printf(" on port %d from port %d with length %d: %s \n",
           receiver_port, sender_port, datalen, data);
   /* this line should work,right?*/
     simple_udp_sendto(&amp;broadcast_connection, "hello",5, sender_addr);
  
  }
  /*---------------------------------------------------------------------------*/
  PROCESS_THREAD(broadcast_example_process, ev, data)
  {
  
  
    PROCESS_BEGIN();
    simple_udp_register(&amp;broadcast_connection, 1900,
                        NULL, 1234,
                        receiver);
  
  
    while(1) {
      PROCESS_WAIT_EVENT();
  
  
  
  
    }
  
    PROCESS_END();
  }
  /*---------------------------------------------------------------------------*/
  </code></pre>
  
  <p><strong>Now the problem is replying to the sender. I want each receiver node reply to the sender which has sent that message to it.</strong>
  I don't know how to do that? 
  simple_udp_sendto() does not work.Can I use this function for this job? How should I use that?</p>