I have some recursive code to operate FtpWebResponse objects, but it always return an error in the recursion.

Code

Error: The operation has timed out.

 

Solution:

System.Net.ServicePointManager.DefaultConnectionLimit = 100//any number you like

Causation:
While running into recursion, the FtpWebResponse object in parent function is still unclosed, the connection become more and more, but its default value is 2 only like below:

Code

 

posted on 2009-09-14 16:02  Gil  阅读(316)  评论(0)    收藏  举报