You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by ALEX HYDE <al...@btinternet.com> on 2005/12/16 13:11:13 UTC
URLConnection
Hi All,
I need to make a very simple get request from a remote web server each time a user first comes into the site.
I wanted to just use the core HttpURLConnection class. It will be thread safe because the object will be used and created in method scope. In the Sun javadoc it says that underneath the covers, the Connection can be shared. So the question is, is this an expensive operation or am I ok to just create a new HttpURLConnection each time a user first enters the site? I noticed that Apache Commons have a version of an HttpClient, in which they explicitly mention pooling connections in a multi-threaded environment. Can I just use the standard HttpURLConnection or will I quickly run out of resources/connections? Should I be using something along the lines of the Commons Client
Thanks alot
---------------------------------
Yahoo! Messenger NEW - crystal clear PC to PC calling worldwide with voicemail