Discussion:
InternetReadFile hangs (reprise)
(too old to reply)
Paul Hatcher
2005-11-12 08:05:59 UTC
Permalink
Hello,

I have an FTP client which sometimes hangs in InternetReadFile. I'm using
synchronous calls btw.

About 99% of transfers are fine, but occasionally InternetReadFile hangs
reading the first block of data
on a newly opened file. However, I've never seen the problem occur when I
initiate passive FTP transfers.

Now I've seen other similar posts regarding this problem and a recent post
regarding disconnect but no one has yet posted
any answer.

Any clues anyone?

Regards,

Bob
Paul Baker
2005-11-12 17:53:25 UTC
Permalink
It could be a firewall or, less likely, a virus scanner, anti-spyware, etc.
It could be software or hardware. Do you have any of those things? Do you
have Windows Firewall enabled? If so, you can try temporarily turning them
off for troubleshooting or checking their configuration. Can you reproduce
this kind of behaviour using Internet Explorer or the FTP command?

Traditional non-passive transfers use the PORT command. Firewalls are
notorious for disliking this command, as it makes you computer act as a
server. It tells the FTP server what port it should connect to your computer
on.

Passive transfers use the PASV command. The FTP server tells your computer
which port you should connect to.

FTP is firewall unfriendly in general as, either way, it is opening up a
random port number for transfers.

Paul
Post by Paul Hatcher
Hello,
I have an FTP client which sometimes hangs in InternetReadFile. I'm using
synchronous calls btw.
About 99% of transfers are fine, but occasionally InternetReadFile hangs
reading the first block of data
on a newly opened file. However, I've never seen the problem occur when I
initiate passive FTP transfers.
Now I've seen other similar posts regarding this problem and a recent post
regarding disconnect but no one has yet posted
any answer.
Any clues anyone?
Regards,
Bob
Paul Hatcher
2005-11-15 11:26:47 UTC
Permalink
Paul,

Thank you for your response. The server(s) are on the same network, so there
are is no third box/firewall involved.
I've also turned off windows firewall. I'm running under Windows XP SP2.

I can't reproduce the problem using Windows explorer, but I have no idea
whether windows explorer uses wininet. Or
how to configure the passive option.

I'm currently resigned to connecting in passive mode only.

Regards,

Bob
Post by Paul Baker
It could be a firewall or, less likely, a virus scanner, anti-spyware,
etc. It could be software or hardware. Do you have any of those things? Do
you have Windows Firewall enabled? If so, you can try temporarily turning
them off for troubleshooting or checking their configuration. Can you
reproduce this kind of behaviour using Internet Explorer or the FTP
command?
Traditional non-passive transfers use the PORT command. Firewalls are
notorious for disliking this command, as it makes you computer act as a
server. It tells the FTP server what port it should connect to your
computer on.
Passive transfers use the PASV command. The FTP server tells your computer
which port you should connect to.
FTP is firewall unfriendly in general as, either way, it is opening up a
random port number for transfers.
Paul
Post by Paul Hatcher
Hello,
I have an FTP client which sometimes hangs in InternetReadFile. I'm using
synchronous calls btw.
About 99% of transfers are fine, but occasionally InternetReadFile hangs
reading the first block of data
on a newly opened file. However, I've never seen the problem occur when I
initiate passive FTP transfers.
Now I've seen other similar posts regarding this problem and a recent
post regarding disconnect but no one has yet posted
any answer.
Any clues anyone?
Regards,
Bob
Paul Baker
2005-11-15 14:53:43 UTC
Permalink
Bob,

Internet Explorer does use WinInet.

Paul
Post by Paul Hatcher
Paul,
Thank you for your response. The server(s) are on the same network, so
there are is no third box/firewall involved.
I've also turned off windows firewall. I'm running under Windows XP SP2.
I can't reproduce the problem using Windows explorer, but I have no idea
whether windows explorer uses wininet. Or
how to configure the passive option.
I'm currently resigned to connecting in passive mode only.
Regards,
Bob
Post by Paul Baker
It could be a firewall or, less likely, a virus scanner, anti-spyware,
etc. It could be software or hardware. Do you have any of those things?
Do you have Windows Firewall enabled? If so, you can try temporarily
turning them off for troubleshooting or checking their configuration. Can
you reproduce this kind of behaviour using Internet Explorer or the FTP
command?
Traditional non-passive transfers use the PORT command. Firewalls are
notorious for disliking this command, as it makes you computer act as a
server. It tells the FTP server what port it should connect to your
computer on.
Passive transfers use the PASV command. The FTP server tells your
computer which port you should connect to.
FTP is firewall unfriendly in general as, either way, it is opening up a
random port number for transfers.
Paul
Post by Paul Hatcher
Hello,
I have an FTP client which sometimes hangs in InternetReadFile. I'm
using synchronous calls btw.
About 99% of transfers are fine, but occasionally InternetReadFile hangs
reading the first block of data
on a newly opened file. However, I've never seen the problem occur when
I initiate passive FTP transfers.
Now I've seen other similar posts regarding this problem and a recent
post regarding disconnect but no one has yet posted
any answer.
Any clues anyone?
Regards,
Bob
Loading...