Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NetServices does not rename automatically



Hi Stefan,

You'll need to use [NSNetService publishWithOptions:0] to get automatic renaming. Also, your service type shouldn't have underscores in it so it would be better to use "_boinx- licenses._tcp". Even better would be to not use Bonjour for copy protection at all. ;-)

Best Regards,

-Marc


On Jul 2, 2008, at 5:24 AM, Stefan Neumärker wrote:

Hi all,

I want to benefit from the fact that Bonjours is renaming a services, if the same name is already in use in the Network, but it does not on my computers.

- (void)publishServiceWithSerial:(NSString *)inSerial
{
	// create new SocketPort and get current port number
	[self createSocketPort];
	unsigned short currentPortNumber = [self getCurrentPortNumber];
	
	// initialize NetService
	_sendingNetService = [[NSNetService alloc] initWithDomain:@"local."
							     type:@"_boinx_licenses._tcp."
							     name:inSerial
							     port:currentPortNumber];
	
	if (_sendingNetService) {
        	[_sendingNetService setDelegate:self];

		// publish
       		[_sendingNetService publish];
    }
}

All I got back was a NSNetServicesCollisionError in - netService:didNotPublish:

I expected to get inSerial-n as serviceName. As a workaround I change the name in -netService:didNotPublish:, but I think something is going wrong here and I don't know what. I'm running 10.5.4


Has anyone an idea?

	Stefan
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Bonjour-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/bonjour-dev/email@hidden

This email sent to email@hidden

_______________________________________________ Do not post admin requests to the list. They will be ignored. Bonjour-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/bonjour-dev/email@hidden

This email sent to email@hidden
References: 
 >NetServices does not rename automatically (From: Stefan Neumärker <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.