• 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: [OSX Core Foundation]How can I asynchronously upload a file though HTTP and get a callback called while sending bytes of the stream?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [OSX Core Foundation]How can I asynchronously upload a file though HTTP and get a callback called while sending bytes of the stream?


  • Subject: Re: [OSX Core Foundation]How can I asynchronously upload a file though HTTP and get a callback called while sending bytes of the stream?
  • From: "Quinn \"The Eskimo!\"" <email@hidden>
  • Date: Thu, 2 Dec 2010 16:10:53 +0000

On 2 Dec 2010, at 12:46, Rémy Saissy wrote:

> as shown in SampleURLConnection, I created a CFWriteStreamRef using a
> CFSocket previously created and connected to the server and configured
> with
> 	CFSocketSetSocketFlags(sock, kCFSocketAutomaticallyReenableWriteCallBack);
> 	CFSocketEnableCallBacks(sock, kCFSocketWriteCallBack);
> event though there is no Write callback defined at socket level.

OK, I've very confused by this.  SimpleURLConnections doesn't use CFSocket at all, and there really should be no need to use CFSocket to solve this problem (except insofar as the system uses CFSocket as the underlying substrate of CFNetwork).

Earlier I wrote:

> o large transfers -- If you're uploading a plain file, you can create a stream for that file using either CF or NSStream and then set it as the content body using -[NSMutableURLRequest setHTTPBodyStream:].
>
> If the file needs some sort of header or trailer you'll have to use a bound pair of streams, as illustrated by the PostController class in the SimpleURLConnections sample code (which is for iOS, but the technology works identically on Mac OS X).

You only need to mess around with a bound pair if you are not sending a simple flat file.  So, what data are you trying to put into the HTTP body?

S+E
--
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

  • Follow-Ups:
    • Re: [OSX Core Foundation]How can I asynchronously upload a file though HTTP and get a callback called while sending bytes of the stream?
      • From: Rémy Saissy <email@hidden>
References: 
 >[OSX Core Foundation]How can I asynchronously upload a file though HTTP and get a callback called while sending bytes of the stream? (From: Rémy Saissy <email@hidden>)
 >Re: [OSX Core Foundation]How can I asynchronously upload a file though HTTP and get a callback called while sending bytes of the stream? (From: "Quinn \"The Eskimo!\"" <email@hidden>)
 >Re: [OSX Core Foundation]How can I asynchronously upload a file though HTTP and get a callback called while sending bytes of the stream? (From: Rémy Saissy <email@hidden>)
 >Re: [OSX Core Foundation]How can I asynchronously upload a file though HTTP and get a callback called while sending bytes of the stream? (From: "Quinn \"The Eskimo!\"" <email@hidden>)
 >Re: [OSX Core Foundation]How can I asynchronously upload a file though HTTP and get a callback called while sending bytes of the stream? (From: Rémy Saissy <email@hidden>)

  • Prev by Date: Re: Problem sending UDP broadcast on OS/X 10.5 Leopard on MacPro1, 1
  • Next by Date: Re: [OSX Core Foundation]How can I asynchronously upload a file though HTTP and get a callback called while sending bytes of the stream?
  • Previous by thread: Re: [OSX Core Foundation]How can I asynchronously upload a file though HTTP and get a callback called while sending bytes of the stream?
  • Next by thread: Re: [OSX Core Foundation]How can I asynchronously upload a file though HTTP and get a callback called while sending bytes of the stream?
  • Index(es):
    • Date
    • Thread