title: Usage example to connect two iOS devices over bluetooth? (client/server code)
body: <p>I do not want to use GameKit. I am trying to use a low-level approach using dns_sd.h and methods like <a href="https://stackoverflow.com/questions/3844189/bonjour-over-bluetooth-without-gamekit/8273661">DNSServiceRegister</a> to establish and maintain a connection. However, I found a wrapper for this called HHServices... Honestly at this point either a low-level answer using dns_sd or a high-level answer using HHServices is welcome.</p>
  
  <p>Here is <a href="https://github.com/tolo/HHServices" rel="nofollow noreferrer">HHServices</a>. Here is <a href="https://github.com/robbiehanson/CocoaAsyncSocket" rel="nofollow noreferrer">GCDAsyncSocket</a>.</p>
  
  <p>This is the code I have so far. I am able to successfully publish the HHService and the GCDAsyncSocket, and also start browing for HHServices on the other device, but no connection is made. Any help? :D</p>
  
  <h1>Server Side</h1>
  
  <h3>Here's where I publish the HHService:</h3>
  
  <pre><code>//....
  NSUInteger serverPort = 19997;
  HHServicePublisher *publisher = [[HHServicePublisher alloc] initWithName:@"MyDisplayName" type:@"_myexampleservice._tcp." domain:@"local." txtData:nil port:serverPort];
  
  GCDAsyncSocket *listenSocket = [[GCDAsyncSocket alloc] initWithDelegate:self delegateQueue:dispatch_get_main_queue()];
  
  NSError *error = nil;
  if (![listenSocket acceptOnPort:serverPort error:&amp;error])
  {
      [self alert:@"Error starting GCDAsyncsocket"];
  }
  
  
  publisher.delegate = self;
  if(![publisher beginPublish])
  {
      [self alert:@"Error publishing HHService"];
  }
  else
  {
      [self alert:@"Successfully published HHService"];
  }
  </code></pre>
  
  <h3>This is where I see if a client connected:</h3>
  
  <pre><code>- (void)socket:(GCDAsyncSocket *)sender didAcceptNewSocket:(GCDAsyncSocket *)newSocket
  {
      [self alert:@"didAcceptNewSocket!"];
  }
  </code></pre>
  
  <hr>
  
  <h1>Client-side</h1>
  
  <h3>Where I start browsing</h3>
  
  <pre><code>    HHServiceBrowser *browser = [[HHServiceBrowser alloc] initWithType:@"_myexampleservice._tcp." domain:@"local."];
      browser.delegate = self;
      if(![browser beginBrowse])
      {
          [self alert:@"Couldn't start browsing"];
      }
      else
      {
          [self alert:@"Successfully started browsing"];
      }
  </code></pre>
  
  <h3>Callback for finding the published HHService:</h3>
  
  <pre><code>- (void) serviceBrowser:(HHServiceBrowser*)serviceBrowser didFindService:(HHService*)service moreComing:(BOOL)moreComing {
      [self alert:@"Found a service! "];
  }
  </code></pre>
  
  <p>Could someone shed some light as to what I'm doing wrong?</p>