I have been using the edtFTP.net library to implement FTP client functionality in multi-threaded Windows Service application. Its work well and I like it a lot. However, I am running into problems when FTPing lots of files in quick succession. I receive the following error:
"Only one usage of each socket address (protocol/network address/port) is normally permitted"
Using netstat I can see that I have loads of sockets in the TIME_WAIT state and I believe I am hitting the upper limit of connections that can be made. The easiest way to solve this is to reduce the number of concurrent threads the service uses and reduce the TIME_WAIT registry setting to its lowest permittable value of 30 secs.
However, from stepping through the code it seems that everytime I issue a Put command a new socket is created, used and then losed (enters the TIME_WAIT state). Surely this could easily become a tight bottleneck? Is it possible for the FTPClient to keep a socket open and reuse it over and over again for each Put until the session is closed?
Any help is much appreciated.
Thanks,
Mike.