tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject URLConnection
Date Fri, 16 Dec 2005 12:11:13 GMT
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 
  • Unnamed multipart/alternative (inline, 8-Bit, 0 bytes)
View raw message