• 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: How to Implement Streamed HTTP Request
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to Implement Streamed HTTP Request


  • Subject: Re: How to Implement Streamed HTTP Request
  • From: Daniel Jalkut <email@hidden>
  • Date: Thu, 20 Apr 2006 09:01:33 -0400

Hi Tommy - I accomplished something like what you're describing, though it wasn't trivial.

I ended up using socketpair to create a pair of sockets that I could then create a read and write stream for. Then I pass the read stream to CFNetwork as the "requestBody" ref for the API below. The socket write stream ref is used by my "send data" callback, which gets triggered whenever the "can accept bytes" message comes in to the client.

I implemented this a couple years ago in a shipping product and it has been reliable. But there were some issues raised here about the possible unreliability of socketpair based CFStreams. Maybe somebody can update us on whether there is still cause for concern.

Daniel

On Apr 17, 2006, at 6:06 PM, Tommy Tian wrote:

Hi,All

I want use CFNetwork to implement streamed http post request.For
example send 1024 bytes to HTTPS server every 1 second.

I try use
extern CFReadStreamRef
CFReadStreamCreateForStreamedHTTPRequest(
  CFAllocatorRef     alloc,
  CFHTTPMessageRef   requestHeaders,
  CFReadStreamRef    requestBody)

This function seems fit for data of requestBody is ready for send
before call this function. (like requestBody from a file, or memory),
can't be add any data to requestBody after it been called.

how can I send 100 memory bufferes to http server use one streamed
http request?of course can NOT merge 100 memory bufferes to one big
buffer and send it.

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


This email sent to email@hidden

_______________________________________________ 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: How to Implement Streamed HTTP Request
      • From: "Tommy Tian" <email@hidden>
References: 
 >How to Implement Streamed HTTP Request (From: "Tommy Tian" <email@hidden>)

  • Prev by Date: AsyncSockets connection timeout
  • Next by Date: Re: Parsing proxy exceptions list?
  • Previous by thread: How to Implement Streamed HTTP Request
  • Next by thread: Re: How to Implement Streamed HTTP Request
  • Index(es):
    • Date
    • Thread