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.


The class you're using represents a URL Connection, not an HTTP Server connection, so it's used at the URL level, you can't influence the server connection piece of it. It's possible that the underlying library uses a keepalive HTTP call and holds the connection to the server and, if you use another URL on the same server it reuses it, but sort of doubt it. There is no cocoa class I know of which represents a server connection which you can set up and say 'use this server connection for this URL' nor is there anything in NSURLConnection which says 'use keepalive, I'm probably going to send more requests'. _______________________________________________

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

Reply via email to