I have a search button that accesses the server every time I click it. The problem is that if I click it several times in a row, it will work fine. However, if I wait 5 seconds, the first press will not work. He simply does not receive an answer. The second press will work, and the subsequent button presses until I withstand a certain amount of time (~ 5 seconds)
So, if you are constantly looking for new things for 5 seconds, your first press of a button will do nothing.
This is solved using
System.setProperty("http.keepAlive", "false");
However, I read that this eliminates persistent connections when a new TCP connection should be made every time I click on this button. It is slower, but it is not buggy.
Is this a bad decision? I read that it doesn’t fix anything. I would like to help, thanks.
source
share