This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
Hi Everyone, I have a JAVA client that sometimes hangs up waiting for a response from the server. The basic code where it hangs is as follows: ******** BufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream())); ******** where con is an object of the HttpURLConnection class. I would like to avoid this somehow. I would like the thread to only wait for 10 seconds on this particular line (only on this line) and if a response still doesn�t come, then exception occurs. I can imagine that I have to use the Timer class. Any help in this regard (sample code, ideas) would be highly appreciated. Thanks!