Link to home
Start Free TrialLog in
Avatar of andersen58
andersen58Flag for United States of America

asked on

InternetReadFile very slow on XP

I have a program the uses the wininet.dll for FTP.  My program is syncronizing the contents of a directory on a remote PC with an inhouse WinNT 4.0 FTP server.  Nothing fancy.

I use FtpPutFile and FtpGetFile to move whole files between computers and I use InternetReadFile to read the contents of smaller files that contain status information on each end.  I have used this program for close to 3 years without any problems.  However, within the last few months, I have been getting reports of long, long pauses in the process.  My log files indicate it is always during the call to "InternetReadFile".

One instance reads 10 bytes from a file on the remote end.  It looks like it locks up, but will eventually complete the read and be successful.  However, it takes almost 2 minutes!  It is almost like a reverse DNS timeout, but for the life of me can't imagine "InternetReadFile" doing any sort of DNS hit (?)

Calls to FtpPutFile and FtpGetFile work fine (i.e. a 400K file moves in 5-10 seconds or so on same connection)

All the machines so far are "new" and have either XP Home or Pro.  I've never seen it on 98,me or 2K, although I don't have many in the field any more...

Any thoughts?
Avatar of nffvrxqgrcfqvvc
nffvrxqgrcfqvvc

Are you using InternetReadFile to read the file directly and obtain strings in text documents, or are you using it to download a file to the hard drive?
Avatar of andersen58

ASKER

I am using it to read a string from a text document.  The remote file is "updtdate.txt" and is just one line - the string of "05/04/2006"  (no quotes).  I read 10 bytes using InternetReadFile into a string variable (buffer).  It just takes 1-2 minutes on a few machines??
ASKER CERTIFIED SOLUTION
Avatar of nffvrxqgrcfqvvc
nffvrxqgrcfqvvc

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
The above code works fine.  However, the actual problem ended up being
an issue with ZoneAlarm.  I have no idea why, but when ZoneAlarm pops up
it's "Allow or Disallow" screen and you choose to allow the program access,
it WILL let FTPGetFile and FTPPutFile commands to work, but InternetReadFile
is still getting block/delayed...