0

In Java I'm using HttpClient, and I have set a connection timeout and socket timeout for this object. When I call the execute method, it hits my server-side code, which creates an another thread to handle my server logic, and if socket timeout exception occurs, my client-side is going into catch, where I stop further execution, and my server-side thread executes through the end of the code.

Is there any way I can stop execution on my server-side, if connection timeout occurs.

meskobalazs
  • 15,741
  • 2
  • 40
  • 63
Raj K
  • 458
  • 2
  • 7
  • 22
  • Check this post. http://stackoverflow.com/questions/37318461/how-to-stop-next-thread-from-running-in-a-scheduledthreadpoolexecutor/37319899#37319899 – Ravindra babu May 20 '16 at 14:12
  • Thanks @Ravindrababu, the above post helps me to understand how to stop the execution on server, but I'm not sure how to implement it in my code basically my client is a java file which performs httpClient.execute -> which calls a servlet and in servlet doPost is executing. At the client execution goes into catch after timeout but my servlet still keeps on executing without any exception – Raj K May 20 '16 at 14:46
  • I don't think you can achieve it. – Ravindra babu May 20 '16 at 16:02

0 Answers0