• 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: kCFSocketWriteCallBack
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: kCFSocketWriteCallBack


  • Subject: Re: kCFSocketWriteCallBack
  • From: "Quinn \"The Eskimo!\"" <email@hidden>
  • Date: Mon, 18 Aug 2014 09:44:17 +0100

On 16 Aug 2014, at 00:59, Jeremy Thompson <email@hidden> wrote:

> I need to be able to get away from CFSocketSendData as it does seem to block, taking too much time.

CFSocketSendData is a fairly thin wrapper around <x-man-page://2/send> (<x-man-page://2/sendto> if you include an address).  It only blocks if the underlying socket is in blocking mode.  In general, if you're using CFSocket in async mode, you want the socket to be non-blocking.  Do this with F_SETFL as described in <x-man-page://2/fcntl>.

Notwithstanding the above, in my experience the various CFSocket wrappers, like CFSocketSendData, are more trouble that they're worth.  When I'm using CFSocket I typically use it /just/ for run loop integration and do all my socket operations using BSD Sockets APIs (which have well-defined, if ugly, semantics).

Share and Enjoy
--
Quinn "The Eskimo!"                    <http://www.apple.com/developer/>
Apple Developer Relations, Developer Technical Support, Core OS/Hardware



 _______________________________________________
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


References: 
 >kCFSocketWriteCallBack (From: Jeremy Thompson <email@hidden>)

  • Prev by Date: kCFSocketWriteCallBack
  • Next by Date: Crash closing bound stream pair, in _CFWriteStreamCopyRunLoopsAndModes
  • Previous by thread: kCFSocketWriteCallBack
  • Next by thread: Crash closing bound stream pair, in _CFWriteStreamCopyRunLoopsAndModes
  • Index(es):
    • Date
    • Thread