Hi,
I am trying to use FtpWebRequest and my program works, but very slow. I suppose it is bacuse FtpWebRequest opens connection every time when I try to get some information. So if I want to get full directory listing program creates instance of FtpWebRequest class tree times to make the following request Methods: ListDirectoryDetails, GetFileSize, GetDateTimestamp. (well, it's possible to get file size from directory list and this gives 33% less in connections number, but I want to use framework as much as I can - this is the purpose of FW, right ).
I took this approach from 'FTP Explorer Technology Sample'.
So, I am wondering if there are any ways to speed up that process FtpWebRequest has a KeepAlive property, but if I set it to true and try to use the same instace to get size (GetFileSize) and then modification date (GetDateTimestamp) I receive exception when try to assign Method property.
I suspect that I mess something important. ;)
regards,
Roman.

FtpWebRequest usage
faustoi
Dial
<trace autoflush="true" />
<sources>
<source name="System.Net" maxdatasize="1024">
<listeners>
<add name="MyTraceFile"/>
</listeners>
</source>
</sources>
<sharedListeners>
<add
name="MyTraceFile"
type="System.Diagnostics.TextWriterTraceListener"
initializeData="System.Net.trace.log"
/>
</sharedListeners>
<switches>
Where is the </trace> or do we not need one The example on msdn has the closing tag, yours doesn't.<add name="System.Net" value="Verbose" />
</switches>
CTEZ
< xml version="1.0" >
<configuration>
<system.diagnostics>
<sources>
<source name="System.Net">
<listeners>
<add name="1"/>
</listeners>
</source>
<source name="System.Net.Sockets">
<listeners>
<add name="1"/>
</listeners>
</source>
<source name="System.Net.Cache">
<listeners>
<add name="1"/>
</listeners>
</source>
</sources>
<switches>
<add name="System.Net" value="Verbose"/>
<add name="System.Net.Sockets" value="Verbose" />
<add name="System.Net.Cache" value="Verbose" />
</switches>
<sharedListeners>
<add name="1" type="System.Diagnostics.TextWriterTraceListener" initializeData="g:\tmp\ft-sys.log" traceOutputOptions="DateTime"/>
</sharedListeners>
</system.diagnostics>
</configuration>
change filename to direct output to and enjoy.
Brett Coombs
figure out how many connections are actually being used. The number of FTPWebRequest instances are not always equal to the number of
connections used. PLease use the
http://blogs.msdn.com/dgorti to get a trace file and it will show you how many connections are being open. You should also use a network monitor to clearly see what is going on the wire.
Phillip Bayliss
Roman.