title: udp didReceiveData receiving two times
body: <p>I have the problem that I send an udp Message (broadcast) to a client and get an answer, but this will be displayed two times. When I check the communication an my PC with an UDP listener there is only one message.</p>
  
  <p>May be, someone can give me an info how I can resolve this.</p>
  
  <p>I am using a button to start sending the message!</p>
  
  <pre><code>#import "ViewController.h"
  #import "GCDAsyncUdpSocket.h"
  
  @interface ViewController ()
  {
      long tag;
      GCDAsyncUdpSocket *udpSocket;
  
  }
  
  @end
  
  @implementation ViewController
  
  - (void)setupSocket
  {   udpSocket = [[GCDAsyncUdpSocket alloc] initWithDelegate:self delegateQueue:dispatch_get_main_queue()];
  
      NSError *error = nil;
  
      if (![udpSocket bindToPort:1000 error:&amp;error])
      {
          NSLog(@"Error binding: %@", error);
          return;
      }
      if (![udpSocket beginReceiving:&amp;error])
      {
          NSLog(@"Error receiving: %@", error);
          return;
      }
  
      [udpSocket enableBroadcast:YES error: &amp;error];
  
      NSLog(@"Ready");
  }
  
  - (void)viewDidLoad
  {
      [super viewDidLoad];
  
      if (udpSocket == nil)
      {
          [self setupSocket];
      }
  }
  
  - (void)didReceiveMemoryWarning
  {
      [super didReceiveMemoryWarning];
      // Dispose of any resources that can be recreated.
  }
  
  - (IBAction)send:(id)sender{
      NSString *host = @"192.168.2.255";
      if ([host length] == 0)
      {
          NSLog(@"Address required");
          return;
      }
  
      NSLog(@"%@",host);
  
      int port = 8888;
  
      NSString *msg = @"1,0,1,2";
  
      NSData *data = [msg dataUsingEncoding:NSUTF8StringEncoding];
      [udpSocket sendData:data toHost:host port:port withTimeout:-1 tag:tag];
  
      NSLog(@"SENT (%i): %@", (int)tag, msg);
  
      tag++;
  
  }
  
  - (void)udpSocket:(GCDAsyncUdpSocket *)sock didReceiveData:(NSData *)data
          fromAddress:(NSData *)address
          withFilterContext:(id)filterContext
  {
      NSString *msg = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
  
      if (msg)
      {
          NSLog(@"RECV: %@", msg);
          tag++;
          NSLog(@"%li",tag);
      }
      else
      {
          NSString *host = nil;
          uint16_t port = 0;
          [GCDAsyncUdpSocket getHost:&amp;host port:&amp;port fromAddress:address];
  
          NSLog(@"RECV: Unknown message from: %@:%hu", host, port);
      }
  }
  
  @end
  </code></pre>
  
  <p>Here ist the output!</p>
  
  <pre><code>2013-09-11 09:49:00.132 udptest[5145:907] 15
  2013-09-11 09:49:08.218 udptest[5145:907] 192.168.2.255
  2013-09-11 09:49:08.220 udptest[5145:907] SENT (15): 1,0,1,2
  2013-09-11 09:49:08.319 udptest[5145:907] RECV: 0,0,0,0,0,0,0,0
  2013-09-11 09:49:08.321 udptest[5145:907] 17
  2013-09-11 09:49:08.323 udptest[5145:907] RECV: 0,0,0,0,0,0,0,0
  2013-09-11 09:49:08.324 udptest[5145:907] 18
  </code></pre>
  
  <p>I would be very grateful if someone could help me.</p>