• 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
Threaded Networking sample code
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Threaded Networking sample code


  • Subject: Threaded Networking sample code
  • From: Marc Stibane <email@hidden>
  • Date: Wed, 1 Oct 2008 17:10:53 +0200

My code needs to run all networking routines in a separate NSThread. I have got a library, which I pass a callback routine for communication:

my thread code
    library
        my callback (networking)
    library
my thread code

My callback routine must POST some data to an HTTP server (NSURLConnection), wait for the answer (start a NSRunLoop?), then return to the library.
The library then processes the data. After the library returns to my thread, I can then post a notification to the main thread which handles drawing and user input.
Is there any sample code covering how to use NSURLConnection in a NSThread?


--

In a world without walls and fences,
   who needs windows and gates?




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

  • Next by Date: CFDataGetBytes causes crash in socket callback
  • Next by thread: CFDataGetBytes causes crash in socket callback
  • Index(es):
    • Date
    • Thread