Opening a streaming connection to an HTTP server on iPhone/Cocoa environment?
- by Paul
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