Guest User

Untitled

a guest
Jan 4th, 2013
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. - (BOOL) setupConnection: (DNSSDService*) service
  2. {
  3. NSString *host = [service resolvedHost];
  4. NSUInteger port = [service resolvedPort];
  5. NSLog(@"in setupConnection: host %@ port %u",
  6. host, port);
  7.  
  8. self.sock = [[GCDAsyncUdpSocket alloc]initWithDelegate:self
  9. delegateQueue:dispatch_get_main_queue() ];
  10. NSError *err = nil;
  11. if (![self.sock connectToHost:host onPort:port error:&err]) {
  12. NSLog(@"we goofed: %@", err);
  13. return NO;
  14. }
  15. return YES;
  16. }
  17.  
  18. Error Domain=GCDAsyncUdpSocketErrorDomain Code=4 "Socket closed" UserInfo=0x2630c0 {NSLocalizedDescription=Socket closed}
Add Comment
Please, Sign In to add comment