I'm trying to use NSURLConnection to access an MJPEG stream.
All that I've seen leads me to believe that my delegate should receive a connection:didReceiveResponse: message at the start of each new frame. Apple's documentation mentions this explicitly, and it's also described in this post to the Webkitsdk-dev mailing list:
http://lists.apple.com/archives/Webkitsdk-dev/2005/Dec/msg00036.html
However, it's not working like that for me. I'm getting one connection:didReceiveResponse: message, followed by an indefinite series of connection:didReceiveData: messages. Like this:
connection:didRecieveResponse:
connection:didReceiveData:
connection:didReceiveData:
connection:didReceiveData:
connection:didReceiveData:
... and so on.
The connection definitely isn't finishing or failing, and I'm continuing to receive data long after the first frame must have finished transmitting, but I never get another connection:didReceiveResponse: message. I've tried this with two different network cameras now, and the result is the same.
Does anyone have any idea why this is happening?
(I posted this question on the Cocoa-dev mailing list, but didn't get a response. I'm tearing my hair out over this, so if anyone has any experience at all with multipart streams and NSURLConnection, advice would be much appreciated!)
All that I've seen leads me to believe that my delegate should receive a connection:didReceiveResponse: message at the start of each new frame. Apple's documentation mentions this explicitly, and it's also described in this post to the Webkitsdk-dev mailing list:
http://lists.apple.com/archives/Webkitsdk-dev/2005/Dec/msg00036.html
However, it's not working like that for me. I'm getting one connection:didReceiveResponse: message, followed by an indefinite series of connection:didReceiveData: messages. Like this:
connection:didRecieveResponse:
connection:didReceiveData:
connection:didReceiveData:
connection:didReceiveData:
connection:didReceiveData:
... and so on.
The connection definitely isn't finishing or failing, and I'm continuing to receive data long after the first frame must have finished transmitting, but I never get another connection:didReceiveResponse: message. I've tried this with two different network cameras now, and the result is the same.
Does anyone have any idea why this is happening?
(I posted this question on the Cocoa-dev mailing list, but didn't get a response. I'm tearing my hair out over this, so if anyone has any experience at all with multipart streams and NSURLConnection, advice would be much appreciated!)