开发者

WCF Client crashes and disables all other tcp/ip connections

I've got a WCF client that I use to talk to a WCF host. The client communicates with the host every 2 minutes to send some info, after which I execute a Close() on the connection. The following runs every two minutes:

var binding = new NetTcpBinding(SecurityMode.None, false);
binding.CloseTimeout = TimeSpan.FromMinutes(1);
binding.OpenTimeout = TimeSpan.FromMinutes(1);
binding.ReceiveTimeout = TimeSpan.FromMinutes(10);
binding.SendTimeout = TimeSpan.FromMinutes(1);
binding.TransferMode = TransferMode.Buffered;
binding.TransactionProtocol = TransactionProtocol.OleTransactions;
binding.HostNameComparisonMode = HostNameComparisonMode.StrongWildcard;
binding.ListenBacklog = 10;
binding.MaxBufferPoolSize = 524288;

// Default is 65536
binding.MaxBufferSize = 965536;
binding.MaxConnections = 10;

// Default is 65536
binding.MaxReceivedMessageSize = 965536;

binding.ReaderQuotas.MaxDepth = 32;
binding.ReaderQuotas.MaxStringContentLength = 90000;
binding.ReaderQuotas.MaxArrayLength = Int32.MaxValue;
binding.ReaderQuotas.MaxBytesPerRead = 4096;
binding.ReaderQuotas.MaxNameTableCharCount = Int32.MaxValue;

wcfClient = new LabStatsServiceClient(binding, new EndpointAddress(endPointAddress));   

try {
   // Do some communication with the server
   ...
} finally {
   // Close the connection
   wcfClient.Close();
}

On some machines -- a rare few -- the client will run li开发者_开发问答ke this for 2 days then suddenly stop working. When it stops working, all sorts of things get bizarre on the client. Nothing related to TCP/IP works. From the client, I can no longer telnet to any other service, browse any website, open up RDP sessions to other PCs, etc. As soon as I restart the client everything clears up and works again.

It seems like there's something related to leaking going on -- either a leaked tcp connection, or perhaps a memory leak, though I'm not sure what it would be. Is there more I need to do besides closing it to prevent leaks? Any other suggestions on how to fix or diagnose the problem?

UPDATE

I just wanted to mention that I've used process explorer and the Tcp/ip tab only shows at most 3 items.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜