Random "Failed to connect to 127.0.0.1 port 32400: Address already in use" errors during scan

It appears that I’m running into the same issue as the following post, netstat is showing thousands of connections to 127.0.0.1:32400 in TIME_WAIT state:

I’ve increased my ephemeral port limit and now the scan ran without errors. Is it normal for Plex to be creating so many lingering connections during scans?

I also decreased my Windows 10 TcpTimedWaitDelay OS setting (registry setting) to make the lingering connections go away faster.

It appears that both these settings (TCP port limit and TcpTimedWaitDelay) need to be adjusted when you have a large library, otherwise scans can fail.