After an application I wrote was running for a while all TCP communication stopped to work (couldn’t create new sockets). Creating a new socket cause “An operation on socket could not be performed because the system lacked sufficient buffer space or because a queue was full” error.
I read across the internet that it seems that I caused windows to use all the “ephemeral” ports, but when I check using “netstat -a” I don’t see “hundereds” of open sockets.
The application is a TCP client/server.
I’ve been trying to think over and over what could cause this issue, but I’m really stuck…
Any help from anyone?
Thanks!
Ephemeral ports have few limitations: can only be 4000 unique connections from a client machine to a remote service at one time (TIME_WAIT).
TIME_WAIT is usually configured to be 240 seconds.
You could have only 4000 connections per 240 second.