Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
4.3k views
in .NET FTP by (200 points)
Then I get an exception "Unable to read data from the transport connection.". After that, I can no longer write to the transport either. Seems to die at about 50 uploads into the session; give or take a handful. I'm using the free version. Is there a limitation on the free version?

Any ideas what i should look at?

tks

5 Answers

0 votes
by (162k points)
DirDetails uses a new socket/port every time it is called, as it is a data transfer. This is how the FTP protocol works.

Unfortunately, if you call it too many times in succession (or do too many downloads or uploads), you will run out of sockets on your client machine as you have done below.

There is no limitations on the free version - you simply cannot transfer that rapidly.

Then I get an exception "Unable to read data from the transport connection.". After that, I can no longer write to the transport either. Seems to die at about 50 uploads into the session; give or take a handful. I'm using the free version. Is there a limitation on the free version?

Any ideas what i should look at?

tks
0 votes
by (200 points)
I assume this is some limited range of ports-- not all 64k of them. ;) Is this because of passive mode or does active mode work this way too. Is the workaround to Quit() and reconnect?


tks. I knew it had to be some resource limit but I didnt' think of ports.
0 votes
by (162k points)
All operating systems have a limit to the number of ports that can be open simultaneously. When a socket closes, it goes into TIME_WAIT state which normally takes 2 minutes to expire - so lots of rapid transfers mean that the limit is quickly reached.

If you use "netstat -a" you will be able to see all the TIME_WAITs.

I assume this is some limited range of ports-- not all 64k of them. ;) Is this because of passive mode or does active mode work this way too. Is the workaround to Quit() and reconnect?


tks. I knew it had to be some resource limit but I didnt' think of ports.
0 votes
by (200 points)
Is there anyway to free up/reuse these used sockets faster? Or do I just have to sleep for a couple minutes and let the OS expire them?
0 votes
by (162k points)
You will have to sleep. Your OS may have a setting to allow TIME_WAIT to be reduced, but you have to be careful - its purpose is to prevent duplication IP packet numbers in your network.

Is there anyway to free up/reuse these used sockets faster? Or do I just have to sleep for a couple minutes and let the OS expire them?

Categories

...