File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes I/O and Streams and the fly likes Manage connection time while using HttpURLConnection Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » I/O and Streams
Reply Bookmark "Manage connection time while using HttpURLConnection" Watch "Manage connection time while using HttpURLConnection" New topic
Author

Manage connection time while using HttpURLConnection

Marcelo Tataje
Ranch Hand

Joined: Jan 31, 2011
Posts: 62

Hello everybody, I'm implementing a method in which I can validate if a Web Service is active, I've validated this by using HttpURLConnection, for example, my url is:
http://192.168.1.89/testWService

If it is not active (because the server is not started or the web service is not deployed) the method returns false. If everything is ok, then it returns true. It runs perfectly but it takes so long sometimes and I want to manage that. I mean, for example, I'm trying to connect and after 15 seconds the command url.openConnection().connect() is executed, it shows me a message like "The connection will take more time than it expected, please be patient" or something like that. somebody told me I should use threads but I don't thin that would help me. I would like to know if there's a method or maybe I could manage it by inheritance overwriting the methods of the HttpURLConnection class.

If somebody could help me please, I beg for some help, I would really be really grateful. Thanks in advance.
 
IntelliJ Java IDE
 
subject: Manage connection time while using HttpURLConnection
 
Threads others viewed
Web service using HttpURLConnection
Manage connection time while using HttpURLConnection
Using Axis ,but unable to get WSDL for parameterised method
Resolving relative URLs in HttURLConnection response message
Jdbc, j_security, and other issues
IntelliJ Java IDE

cast iron skillet 49er

more from paul wheaton's glorious empire of web junk: cast iron skillet diatomaceous earth rocket mass heater sepp holzer raised garden beds raising chickens lawn care CFL flea control missoula heat permaculture