CFReadStream and keep-alive
CFReadStream and keep-alive
- Subject: CFReadStream and keep-alive
- From: John Michael Zorko <email@hidden>
- Date: Wed, 20 Jan 2010 15:38:54 -0800
Hello, all ...
I want to adapt some CFReadStream-based code I have to keep a persistent connection to the server so that additional requests won't incur the overhead of establishing a new connection. Currently, I just create a CFReadStream by creating a CFHTTPMessage with CFHTTPMessageCreateRequest, and passing that request to CFReadStreamCreateForHTTPRequest(). This works fine, but I want to be able to send additional HTTP requests without closing the connection to the server and opening it again. I've a couple of questions, though:
1. How to I keep the connection open once my callback gets called with kCFStreamEventEndEncountered?
2. It is my understanding that every new HTTP request needs a new CFReadStream, so how do I tell the CFReadStream to _not_ initiate a new connection, but rather, keep using the current one?
3. Is setting the HTTP keep-alive header to the correct value all I need to do, or do I need to do something else?
Regards,
John
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden