• Post Reply Bookmark Topic Watch Topic
  • New Topic

JDK 1.4 javax.net.SocketFactory and HttpURLConnection  RSS feed

Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi every body,
JavaSoft has solved the bug of InputStream.read() that blocks forever if the network conditions are bad.
They have introduced in JDK 1.4 the SocketTimeoutException exception, and also the javax.net.SocketFactory that customizes the way sockets are created.
I was expecting that for example, HttpURLConnection, would provide a new method called setSocketFactory(SocketFactory) to customize the underlying socket, but I did not find any !!!
Ok, I will subclass SocketFactory, and I will override its abstract methods. But what should I do to tell HttpURLConnection to use this SocketFactory to create its underlying socket ???
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!