This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Make HTTPURLConnection time out  RSS feed

 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I followed some threads about timing out an HTTPURLConnection over in the sockets etc. forum. One approach I liked was putting a command on a timer that would close the connection when the timer went off. If the communication worked before that, the main thread could cancel the timer. That made good sense but I believe I can't use timer to run new threads in my EJB container.

So I popped over to this forum. Any other ideas to make this time out in a configurable amount of time?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!