Hi Kiran,
You need to "retain" the aNetService in the didFindService method
before resolving it. That should solve your problem. Also, unless
you're purposely limiting your service discovery to the local-link,
you should be passing in empty string for the browse domain, in order
to support wide-area Bonjour.
Best Regards,
-Marc
On Jan 4, 2006, at 5:54 AM, Jyothi Swaroop wrote:
> hi everybody,
>
> I am working in development of tool which uses bonjour
> to publish and discover services over LAN . I have a problem in
> using bonjour API , i have a single delegate object which listens
> for more than two service types in local domain. I am able to
> discover the services every time, but not able to resolve the
> discovered service every time. If once it is able to resolve the
> service,next time it is not able to resolve it. The behavior is
> unpredictable, nor i am getting message to didntResolveNetservice:
> delegate. The code in the didFindService: method is like this,
>
>
> - (void)netServiceBrowser:(NSNetServiceBrowser *)aNetServiceBrowser
> didFindService:(NSNetService *)aNetService moreComing:(BOOL)moreComing
> {
> [aNetService setDelegate:self];
> [aNetService resolveWithTimeout:20];
> }
>
> the code for searching services is
>
> for(i=0 ; i<[serviceTypeArray count] ; i++)
> {
>
> NSNetServiceBrowser *aBrowser = [[NSNetServiceBrowser alloc] init];
> [aBrowser setDelegate:bonjourServicesDelegate];
> [aBrowser searchForServicesOfType:[servicesArray objectAtIndex:i]
> inDomain:@"local."];
> [serviceBrowserDict setObject:aBrowser forKey:[servicesArray
> objectAtIndex:i]];
>
> [aBrowser release];
> }
>
> is there anything left out to be done while publishing or
> discovering to make it work perfectly.
> if any one has any idea about the problem, please give me a
> suggestion.
>
> thanks & regards,
> Kiran.
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Bonjour-dev mailing list (
Bonjour-dev@list...)
> Help/Unsubscribe/Update your Subscription:
>
http://lists.apple.com/mailman/options/bonjour-dev/marc%40apple.com
>
> This email sent to
marc@appl...
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Bonjour-dev mailing list (
Bonjour-dev@list...)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/bonjour-dev/subscriber%40opensubscriber.com
This email sent to
subscriber@open...
opensubscriber is not affiliated with the authors of this message nor responsible for its content.