0

I have an Angular service to handle my REST calls to an Apache server. There are instances when a user makes several REST calls in a row. When this happens, Chrome will hold a socket open for each request. The sockets are kept open for 60 seconds and are not reused. Eventually a limit is hit and all subsequent requests are held as "pending" until a socket is cleared. I have researched the Chrome "Waiting for available socket" issue, however all of the solutions point towards a client side fix of clearing sockets through Chrome. This issue does NOT appear when hitting my REST API on my localhost Apache server.

I would think there has to be a server side solution or a way in Angular to clear or reset the socket.

I am using: Chrome Version 68.0.3440.106 Ubuntu 16.04 Apache version 2.4.7

mminnie
  • 152
  • 1
  • 2
  • 11
  • Stop making so many requests. – Reactgular Aug 20 '18 at 18:58
  • I'm assuming you saw [this answer](https://stackoverflow.com/questions/23679968/chrome-hangs-after-certain-amount-of-data-transfered-waiting-for-available-soc), but just in case...there it is. – trueCamelType Aug 20 '18 at 21:00
  • I saw the post @trueCamelType. The solutions aren't viable for me. I don't know why this happens on a production server and NOT when testing in my development environment on LOCALHOST. – mminnie Aug 20 '18 at 22:26

1 Answers1

0

The sockets were being kept open by a secondary script that would run after the return of the REST call. These scripts were timing out (missing resource on the server) at 60 seconds. So after I initially made 6 (Chrome socket limit) REST calls that returned successfully...the secondary script was keeping the socket open until it timed out on the server.

mminnie
  • 152
  • 1
  • 2
  • 11