• 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
Re: UNIX Network Programming
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: UNIX Network Programming


  • Subject: Re: UNIX Network Programming
  • From: Jens Alfke <email@hidden>
  • Date: Mon, 30 Nov 2009 08:53:10 -0800


On Nov 29, 2009, at 6:39 PM, Joe Turner wrote:

I've been using NSNetservices over bonjour for a while for network programming, and they always seem to give me trouble. I'm thinking of completely switching away from auto-discovery, and would like to get into low-level unix networking.

I think you're mixing apples and oranges here. NSNetService (and related Bonjour APIs) are for service discovery: they identify services and tell you their IP addresses. Connection and communication are up to you — you can use NSStream, CFSocket, POSIX socket calls, libcurl, OpenSSL, whatever's appropriate.

It's true that NSNetService has a method to open NSStreams, but it's just a convenience — all it does is use public APIs to resolve the service's address and then calls the NSStream factory method to open connections to that address. You certainly don't have to use it.

If you're having trouble with NSStreams for TCP sockets, that's not directly related to Bonjour or auto-discovery. Maybe if you describe the problems we can resolve them — lots of people have gotten these APIs to work reliably. You could certainly avoid those specific problems by using POSIX APIs, but you'll end up trading them for other problems :) such as threading, buffering, timeouts, multiplexing multiple sockets via select() or kqueues, ...

—Jens
 _______________________________________________
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: UNIX Network Programming
      • From: Joe Turner <email@hidden>
References: 
 >UNIX Network Programming (From: Joe Turner <email@hidden>)

  • Prev by Date: Re: UNIX Network Programming
  • Next by Date: Re: UNIX Network Programming
  • Previous by thread: Re: UNIX Network Programming
  • Next by thread: Re: UNIX Network Programming
  • Index(es):
    • Date
    • Thread