X-Git-Url: http://git.ithinksw.org/ITFoundation.git/blobdiff_plain/b64cdf3e84e76273251024a99bbe275ed1eeae4b..1d23d1181a753fffef7a9d28db4b0b0546bd0032:/ITInetServerSocket.m diff --git a/ITInetServerSocket.m b/ITInetServerSocket.m index 61791f8..08a8fe0 100755 --- a/ITInetServerSocket.m +++ b/ITInetServerSocket.m @@ -185,7 +185,9 @@ static NSMutableSet *servsockets; - (void)setupRendezvousAdvertising { - service = [[NSNetService alloc] initWithDomain:@"" type:[NSString stringWithFormat:@"_%@._tcp.",rndType] name:rndName port:htons(port)]; + NSString *a = [NSString stringWithFormat:@"_%@._tcp.",rndType]; + service = [[NSNetService alloc] initWithDomain:@"" type:a name:rndName port:htons(port)]; + NSLog(@"Advertising a service of type %@ name %@",a,rndName); [service publish]; } @@ -202,6 +204,7 @@ static NSMutableSet *servsockets; NSConnection *dcon = [[NSConnection alloc] initWithReceivePort:p1 sendPort:p2]; NSArray *par = [NSArray arrayWithObjects:p2,p1,nil]; [dcon setRootObject:self]; + NSLog(@"detached server thread"); [NSThread detachNewThreadSelector:@selector(socketAcceptLoop:) toTarget:self withObject:par]; } @@ -226,6 +229,7 @@ static NSMutableSet *servsockets; { signed int cfd; cfd = accept(sockfd,NULL,NULL); + NSLog(@"Someone connected!"); [(id)dp newClient:cfd]; } dieflag = 0;