On Tue, Jan 20, 2009 at 7:49 PM, Mohan Parthasarathy <surut...@gmail.com> wrote: >> Is there a way to not to allocate the connection everytime i need to send >>>>> a new request ? >>>>> >>>> >>>> Yes. I'm pretty sure that the URL loading framework will use HTTP >>>> keepalives automatically when appropriate. >>>> >>> >>> I am not sure i undrstood this. If i allocate a NSURL connection >>> everytime >>> i need to fetch from a URL, wouldn't it set up a TCP connection everytime >>> and then download the data. If i can avoid that, wouldn't it be nice ? >>> >> >> Again, I'm pretty sure that the Cocoa URL loading functions will do this >> for you as appropriate. Trying to implement it yourself is unnecessary, and >> trying to go about it this particular way is futile as well as incorrect. > > > I don't want to do this myself. But i don't see anything in NSURLConnection > that would do this. If so, please point to me.
*Do* *not* *make* *assumptions*. You're making a huge assumption here: A) NSURLConnections must be reused in order to have persistent HTTP connections. And then we have this simple fact: B) There is no way to reuse an NSURLConnection. Putting these two together, we have a conclusion: C) NSURLConnection does not allow persistent HTTP connections. Since conclusion C is pretty much absurd, it would follow that perhaps assumption A is wrong. But don't assume. *Test*. Write some code and then use a network sniffer to see if, in fact, persistent connections are being used. If you don't know how to use a sniffer, this is your golden opportunity to learn. Doing network programming without a sniffer is like doing carpentry without any eyes. A particularly talented person might get astonishingly far without them, but he's still going to suffer from a severe handicap relative to a person who can actually see. Above all, please don't come barging onto the mailing list asking about a half-baked solution for a problem that you haven't even verified the existence of. Mike _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com