• 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: Does CFWriteStream coalesce writes?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Does CFWriteStream coalesce writes?


  • Subject: Re: Does CFWriteStream coalesce writes?
  • From: Jens Alfke <email@hidden>
  • Date: Thu, 29 May 2008 11:57:51 -0700


On 29 May '08, at 11:36 AM, Mark Pauley wrote:

Nope, we don't buffer in CFSocketStreamWrite. You might want to take a look at a tcp dump to see just how many bytes per packet you're sending... I would imagine this is a place where we could improve, (signalling canAcceptBytes is probably expensive, as is sending short packets).

Thanks. The issue is that the data to be sent is spread out in multiple locations: I'm multiplexing segments of messages together, each message is in its own buffer, and each segment has to be prefixed with a short header. I don't want to have to copy everything into a single buffer and then make one -write: call.


But if I make multiple write calls in a row, subsequent ones will block if the stream runs out of write space. (Is that a bug?) It seems I'd have to call -hasSpaceAvailable before each call, to preflight.

The ideal call to use would be writev. I'm not sure whether it's safe to combine this with CFStream, however. I know how to extract the file descriptor from the stream, but if I write directly to it am I liable to confuse the stream's internal state?

—Jens

Attachment: smime.p7s
Description: S/MIME cryptographic signature

 _______________________________________________
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: Does CFWriteStream coalesce writes?
      • From: Josh Graessley <email@hidden>
References: 
 >Does CFWriteStream coalesce writes? (From: Jens Alfke <email@hidden>)
 >Re: Does CFWriteStream coalesce writes? (From: Mark Pauley <email@hidden>)

  • Prev by Date: Re: CFNetwork caching HTTPS
  • Next by Date: Re: CFNetwork caching HTTPS
  • Previous by thread: Re: Does CFWriteStream coalesce writes?
  • Next by thread: Re: Does CFWriteStream coalesce writes?
  • Index(es):
    • Date
    • Thread