• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
NSNetService, resolve or not
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSNetService, resolve or not


  • Subject: NSNetService, resolve or not
  • From: email@hidden
  • Date: Thu, 4 Jun 2009 16:02:04 -0700

Hi Group,

This is probably a uninformed question, especially to all you network
gurus, but here goes...

I'm using the NSStream, NSNetService, NSNetServiceBrowser APIs, using
local bonjour only for some 'easy' service discovery and device/desktop
message passing.  No SSL or anything-- at least not yet.  When my browser
connects to an instance of my service (which wraps an underlying simple
TCP server), I found that I can get the netservice and open its streams
(using "getInputStream:outputStream:"), without calling
"resolveWithTimeout:" first.  This actually works pretty well -- I can
send and receive data on both sides with these streams.  Less code too.

However -- this seems kind of strange. Shouldn't I have to resolve the
service to use it?  Thinking this, I put in code to resolve the service
(on the browser side).  But it introduces some err.. complexity-- for
example, if a device goes offline and then back on, the streams get
re-opened.. something that *might* be convenient, or may be unexpected.
Also I have to deal with a more asynchronous connection & setup, although
that's not so bad.    So should or should I not be resolving when using
this for local-only networking, and why?  And why would this work without
resolving?

Thanks!
Michael

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: NSNetService, resolve or not
      • From: Quinn <email@hidden>
  • Prev by Date: any API to get IP address and renew IP address?
  • Next by Date: Redirect browser webpage.
  • Previous by thread: any API to get IP address and renew IP address?
  • Next by thread: Re: NSNetService, resolve or not
  • Index(es):
    • Date
    • Thread