Discussion Locked

How to interrupt a Java API

0 helpful
1 reply
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
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.

1 reply

by redsea

I am interested to see how you have tried to solve this problem. I have a few ideas but I am afraid that they may be similar to what you have done.

please send any relevant information/code to redseaproductions@hotmail.com

This discussion is closed to new replies.