Hi, erm, now I trying to do a messaging between both client instead of client to server. So if I'm not wrong we can't startup service individually but how to see whether is setting up individually or both connect to same service?
My Code for startup the service:
-(void)startService {
// Start listening socket
NSError *error;
self.listeningSocket = [[[AsyncSocket alloc]initWithDelegate:self] autorelease];
if ( ![self.listeningSocket acceptOnPort:0 error:&error] ) {
NSLog(@"Failed to create listening socket");
return;
}
// Advertise service with bonjour
NSString *serviceName = [NSString stringWithFormat:@"Aho- %@",
[[NSProcessInfo processInfo] hostName]];
connectedService = [[NSNetService alloc] initWithDomain:@"" type:@"_cocoaforsci._tcp."
name:serviceName
port:1234];
connectedService.delegate = self;
[connectedService publish];
}
Any suggestion?