• 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: Which API should I use for sockets
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Which API should I use for sockets


  • Subject: Re: Which API should I use for sockets
  • From: Joshua Graessley <email@hidden>
  • Date: Fri, 13 Jun 2003 11:08:29 -0700

I'm not sure where to find this information, but here's a quick overview:

BSD Sockets
Direct access to sockets, portable code.

CFSockets
Wrapper around BSD Sockets to integrate in to a CFRunLoop. Sockets are blocking. They have a non-blocking option, but this requires that the caller either poll which is bad or block on multiple sockets using select. Trying to integrate the use of select in to your CFRunLoop is non-trivial. CFSocket does to work for you, calling a notifier function you supply when there is data on your socket.

NSSockets
I'm not really sure what this is, I'd guess it's similar to CFSockets for someone writing Objective-C code.

So, if your application has a run loop, you'll have better luck using CFSockets than BSD Sockets. If you're using objective-c, you might want to look in to NSSockets. If neither of these apply, you should probably use BSD sockets.

-josh

On Friday, June 13, 2003, at 10:37, Kirk Haderlie wrote:

I am beginning a new project that will use TCP sockets. I am new to OS X
development and would like some opinions on which API we should use.
(CFSockets, NSSockets, or BSD Sockets) If there is any documentation on
Apple's Site that answers this question please direct me there.

Kirk Haderlie
Design Engineer
email@hidden
Vivid Image Technology
www.vividimage.com
_______________________________________________
macnetworkprog mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/macnetworkprog
Do not post admin requests to the list. They will be ignored.
_______________________________________________
macnetworkprog mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/macnetworkprog
Do not post admin requests to the list. They will be ignored.

References: 
 >Which API should I use for sockets (From: Kirk Haderlie <email@hidden>)

  • Prev by Date: Re: Which API should I use for sockets
  • Next by Date: Re: Which API should I use for sockets
  • Previous by thread: Which API should I use for sockets
  • Next by thread: Re: Which API should I use for sockets
  • Index(es):
    • Date
    • Thread