I have several Windows Services that I developed that connect to SQL Server 2008 R2 via TCP/IP on port 1433.
The application is written so that only ONE connection per service is used to connect to SQL Server. But I may see several hundred connections to port 1433 all in the Time Wait state for a given Service.
Whenever one of my Services disconnects or connects from SQL Server, I'm absolutely positive that an entry is written to a log file. Yet for the hundreds of TCP connections to SQL Server that are no log entries whatsoever.
The obvious thought is that my Service is opening and closing a connection to SQL Server for every transaction, but that is not the case here.
As a matter of fact I will see hundreds of tcp connections to SQL Server in the TIME_WAIT state on one of my Services one minute, and the next minute they will all be gone, and then a different Windows Service that I developed will have hundreds of tcp connections to SQL Server in the TIME_WAIT State. Yet both Windows Services process transactions continuously every second..
Is there any possible explanation as to how all these TCP connections to SQL Server occur without my Service actually explicitly opening and closing the database connection? Maybe a MS Bug somewhere??