Re: A simple DO situation - point me in the right direction!
Re: A simple DO situation - point me in the right direction!
- Subject: Re: A simple DO situation - point me in the right direction!
- From: Graham Cox <email@hidden>
- Date: Thu, 20 Aug 2009 22:31:48 +1000
That's a great idea - nice one ;-)
I've made some headway since my earlier post, by starting with Bonjour
using NSNetService and NSNetServiceBrowser. I'm starting to form some
slightly more intelligent (I hope) questions.
Port Number. Given my scenario wouldn't I need to use a fixed port
number? If so, how do I choose one? Can I pick one more or less at
random and hope for the best, or is there a way to get an unused one -
but if I do that, how would all the other little micro-servers know to
pick the same one?
Unique name. Since I don't think my service will ever be visible this
isn't likely to be a big issue, but can I be sure that the host name
is unique for example? I could always use a UUID I guess.
By unpublish I take it you mean calling -stop on the published
NSNetService? Or is there more to it?
--Graham
On 20/08/2009, at 10:08 PM, Kirk Kerekes wrote:
I need to implement a system where I can verify the number of running
copies of my app on a local network against a site license. I thought
DO might be a good way to implement this.
Consider using just Bonjour for this -- with careful implementation
of the name and type service strings, you can probably get what you
want with no DO at all.
The essence will be embedding a license code into the "type" field,
then counting the number of eligible services based on that "type".
The "name" field should be unique on the local subnet.
You can skip the resolution phase.
You would probably end up using Bonjour with DO anyway -- this just
eliminates the DO part.
Don't forget to un-publish your app when it quits.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden