How to interrupt a Java API - TechRepublic
General discussion
August 22, 2000 at 04:40 AM
java_amit

How to interrupt a Java API

by java_amit . Updated 25 years, 10 months ago

Hi, I am using openConnection() of URLConnection to get a connection to a server. If the IP address provided is not leased in the network, then it waits until the java throuws the timeout after 30 to 40 seconds. How can I interrupt or set timeout for the openConnection() API. I tried with calling the API with a separate thread and then kill the thread whenever I want. But it did not work. Please help me. Thanks in advance.

This discussion is locked

All Comments