distributed objects and NSURLConnection

  • I'd like to take an array of URLs pointing to jpegs and asynchronously
    download them. I thought DO would be perfect for this: create an array
    of servers where each have an NSURLConnection, then they return the
    chunk of data back to the client.

    I have set-up the client and the server(with the help of the Advanced
    Mac OS X Programming book) and can call the server but I've run into a
    problem where the NSURL I create in the server is null on
    initialization. Also, creating an NSURLConnection object causes a
    crash(appears to be EXC_BAD_ACCESS but it's hard to be sure because
    'po' in the debugger gives me back nothing. Perhaps there is a basic
    design flaw with this idea?

    I've included a link to my project, requires 10.4. Would be very
    grateful on some suggestions. I put the word FIXME: in the code where
    I'm having issues(just to assist you in finding the problem, not
    assuming or expecting you to do all my work :) )

    Michael

    http://www.sendspace.com/file/gwt7cd
  • On Jan 6, 2008, at 4:15 PM, Michael Hanna wrote:

    > I'd like to take an array of URLs pointing to jpegs and asynchronously
    > download them. I thought DO would be perfect for this: create an array
    > of servers where each have an NSURLConnection, then they return the
    > chunk of data back to the client.

    NSURLConnection is already an asynchronous API, so there is typically
    little need to use background threads - or processes.

    With Leopard you might also want to consider using NSOperation and one
    of the old synchronous APIs.

    j o a r
previous month january 2008 next month
MTWTFSS
  1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31      
Go to today