Threaded Networking sample code

Discussion in 'Programmer Misc' started by Marc Stibane, Oct 1, 2008.

  1. Marc Stibane

    Marc Stibane Guest

    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?


    P.S. I just asked this question at stackoverflow also:
    http://stackoverflow.com/questions/157827/

    --
    In a world without walls and fences,
    who needs windows and gates?
     
    Marc Stibane, Oct 1, 2008
    #1
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Newsbot

    Sample Code: SayIt

    Newsbot, Aug 7, 2006, in forum: Apple Developer News
    Replies:
    0
    Views:
    632
    Newsbot
    Aug 7, 2006
  2. Newsbot

    Sample Code: BlockAnimation

    Newsbot, Aug 7, 2006, in forum: Apple Developer News
    Replies:
    0
    Views:
    582
    Newsbot
    Aug 7, 2006
  3. Newsbot

    Sample Code: Dicey

    Newsbot, Aug 7, 2006, in forum: Apple Developer News
    Replies:
    0
    Views:
    716
    Newsbot
    Aug 7, 2006
  4. Newsbot
    Replies:
    0
    Views:
    669
    Newsbot
    Nov 10, 2006
  5. dorayme
    Replies:
    2
    Views:
    167
    dorayme
    Mar 4, 2006
  6. Mark Geary

    Threaded mail reader?

    Mark Geary, Sep 17, 2006, in forum: Apps
    Replies:
    16
    Views:
    328
    Erik Richard Sørensen
    Sep 20, 2006
  7. Tim Murray

    iSight adapater for tripods with threaded sled

    Tim Murray, Mar 20, 2010, in forum: Video Hardware
    Replies:
    50
    Views:
    1,570
    Tim Murray
    Mar 26, 2010
  8. Renaud Blanch
    Replies:
    1
    Views:
    456
    Miro Jurisic
    Jun 15, 2004
Loading...