IIS Hosted WCF does not recycle "Out of winsock resources" TCP ports

I have a WCF service hosted in IIS 7 that runs successfully for a certain period of time and then cannot connect to other network locations (I suspect there are no TCP ports available to connect to the outside world)

Reference Information:

My system transcodes large media files (which takes time). I have a centrally hosted WCF service, which is located on server A, which will be called the "Central WCF Service". Then I have many client services that actually transcode media files on different servers: B, C, D, E, F, etc., Which will be called "Client Processor Services". The WCF Central Service manages the client processor service that Transcode Jobs sends for processing. Each of these client handlers is a self-service WCF service that basically runs a lengthy process and receives a poll from the central WCF service that checks the percentage of job completion. Therefore, WCF Central Service opens up many connections to these clients,in order to interview them to achieve their results, the survey occurs approximately every 2-3 seconds for each of the clients.

The WCF Central Service stores a string list of addresses for client processor services. The code used to poll each client is described below (stripped down version):

public ClientProcessorClient getClientByaddress(string address)
{
    Binding bidning = new NetTcpBinding(SecurityMode.None);
    return new ClientProcessorClient(bidning, new EndpointAddress(address));
}

public void pollJobs()
{
    foreach (string clientAddress in clients)
    {
        ClientProcessorClient client = getClientByaddress(clientAddress);
        int progress = client.GetProgress();
        client.Close();
        // Do stuff with progress
    }
}

What happens when it breaks:

I can send many recoding jobs to the WCF Central Service, and it sends jobs to clients, successfully updating the progress, etc. After about an hour of processing, the server hosting the central WCF service stops working properly. When trying to contact a WCF client, WCF Central ServiceInsufficient winsock resources available to complete socket connection initiation. . WCF- pingable WCF, . , - , , . , , , . WCF WCF ping. IN, OUT .

:

, .

(Central WCF service Client Processor Service) - .

WCF IIS 7 . .

, ( )

/

, TCP. WCF ClientProcessorClient? ? using? - , /, ?

+3
1

Microsoft - WCF ( ClientBase, ChannelFactory), Close(). , Dispose() - Close(), . , Abort() (, TCP).

- - WCF , Close() Abort(). .

+1

All Articles