Opening a streaming connection to an HTTP server on iPhone/Cocoa environment?

Posted by Paul on Stack Overflow See other posts from Stack Overflow or by Paul
Published on 2010-05-27T20:15:45Z Indexed on 2010/05/27 20:21 UTC
Read the original article Hit count: 163

Filed under:
|
|

I've been using NSURLConnection to do a HTTP post to establish the connection. I've also implemented the didReceiveData delegagate to process incoming bytes as they become available.

As incoming data comes in via didReceiveData, I add the NSData to a data buffer and try parsing the bytesteam if enough data has come in to complete a message segment. I'm having a hard time managing the data buffer (NSMutableData object) to remove bytes that have been parsed to structs. Was curious if there's an easier way.

Thanks

© Stack Overflow or respective owner

Related posts about iphone

Related posts about cocoa