title: how to send UDP data in Objective C with AsyncUdpSocket?
body: <p>I'm trying to send some small data over UDP using the <a href="http://code.google.com/p/cocoaasyncsocket/" rel="nofollow">AsyncUdpSocket library</a>. There is a lot of docs for the TCP connection but none for the UDP connection. </p>
  
  <p>I wrote this class to send 5 bytes to a remote host but it looks like nothing is actually going to the wire. I'm monitoring the network using wireshark but I see no outgoing packets. The delegate method "didSendDataWithTag" is never called :(</p>
  
  <p>Any ideas what I forgot ?</p>
  
  <pre><code>#import "UDPController.h"
  
  @implementation UDPController
  
  - (id)init
  {
      self = [super init];
      if (self) {
          socket = [[AsyncUdpSocket alloc] initWithDelegate:self];
      }
      return self;
  }
  
  
  - (void) sendUDPTest {
      NSLog(@"%s", __PRETTY_FUNCTION__);
  
      NSString * string = @"R/103";
      NSString * address = @"192.168.1.130";
      UInt16 port = 21001;
      NSData * data = [string dataUsingEncoding:NSUTF8StringEncoding];
  
      [socket sendData:data toHost:address port:port withTimeout:-1 tag:1];        
  }
  
  
  /**
   * Called when the datagram with the given tag has been sent.
   **/
  - (void)onUdpSocket:(AsyncUdpSocket *)sock didSendDataWithTag:(long)tag {
          NSLog(@"%s", __PRETTY_FUNCTION__);
  }
  
  
  - (void)dealloc
  {
      [socket release];
      [super dealloc];
  }
  
  @end
  </code></pre>
  
  <p>cheers</p>