Socket.Receive

  • Thread starter Thread starter Sophia Smith
  • Start date Start date
S

Sophia Smith

In my FTP application, after login activity I use NLST command to the FTP
server. After that I read the output buffer data to read the file listings.

When I run through the debug mode I am getting the complete list of files in
the FTP server.

When I run without debug points, when I read the output buffer I am not
getting the complete file list.

1.. Why this could be? I am suspecting that I have to wait for few seconds
so that the FTP server will return the complete data. Any other thoughts?
2.. Incase if I have to introduce the delay, how to do that in VB.Net? Any
sleep function?
I am using VB.Net and .Net Framework 1.1.

Thanks for your reply.

Sophia Smith
 
Sophia,

You are absolutely right. When you run the FTP application without the
break point, the code is checking for the output buffer before the file
is completely transferred. You can put large sleep time, but you cant
be assured that, the time given is sufficient. You can do couple of
things here.

1. You can run this asynchrously and do other task. But this may
require some design changes.
2. You can keep checking the output buffer until it is actually there.

Thanks,
 
Since it is a single threaded application. If I put for sleep for longer
time(System.Threading.Thread.Sleep(nnn) ), will it halt the buffer receiving
part? IF so... then there is no use of the above sleep statement.
Any thoughts. Thanks for your reply.
Sophia.
 
Back
Top