• Post Reply Bookmark Topic Watch Topic
  • New Topic

Make HTTPURLConnection time out

 
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!