RE: FtpPutFile never timeouts
From: Dante (Dante_at_discussions.microsoft.com)
Date: 01/18/05
- Next message: Sergey Bogdanov: "Re: how to do very simple animation?"
- Previous message: Peter Foot [MVP]: "Re: text with hyperlink"
- In reply to: Alex Yakhnin [MVP]: "RE: FtpPutFile never timeouts"
- Next in thread: Peter Foot [MVP]: "Re: FtpPutFile never timeouts"
- Reply: Peter Foot [MVP]: "Re: FtpPutFile never timeouts"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 18 Jan 2005 12:07:02 -0800
The solution provided at the end of that thread is done in vb 6.0 and i don't
think there is a way to convert it to vb.net. Since vb 6.0 doesn't have
threading, it uses some callback function to and Timers instead. What i can
try to do is create a separate thread that sends "NOOP" commands to the ftp
server every minute to see if i'm still connected. The thread that is calling
FtpPutFile then needs to be terminated when the first thread is unable to
send "NOOP" to the server, and there is no way to terminate threads in the
compact framework.
"Alex Yakhnin [MVP]" wrote:
> Have a look at this thread:
>
> http://groups-beta.google.com/group/microsoft.public.vb.winapi/browse_frm/thread/6d9c4a1878a41ce4/d3e114b70ce76874?q=FtpPutFile+timeout&_done=%2Fgroups%3Fq%3DFtpPutFile+timeout%26start%3D20%26hl%3Den%26lr%3D%26c2coff%3D1%26&_doneTitle=Back+to+Search&&d#d3e114b70ce76874
>
> --
> Alex Yakhnin, .NET CF MVP
> www.intelliprog.com
> www.opennetcf.org
> My blog: http://blog.opennetcf.org/ayakhnin
>
> "Dante" wrote:
>
> > Private Declare Function FtpPutFile Lib "wininet.dll" (ByVal hConnect As
> > Integer, ByVal lpszLocalFile As String, ByVal lpszNewRemoteFile As String,
> > ByVal dwFlags As Integer, ByVal dwContext As Integer) As Boolean
> >
> >
> > When i use FtpPutFile to send a file the the ftp server, and the internet
> > connection is lost during the trasfer, FtpPutFile does not timeout and return
> > False like it should. It will sit there forever and never return.
> > I don't have any problem while using other wininet functions while internet
> > connection is lost like FtpSetCurrentDirectory and InternetConnect. They
> > timeout in about 5 seconds and they return false like they should.
> > I have tried using FtpOpenFile and InternetWriteFile as a replacement for
> > FtpPutFile but i get the same problem, it never timeouts when internet
> > connection is lost during a transfer.
> > Is this a known bug for wininet and is there a workaround?
> >
> >
> >
- Next message: Sergey Bogdanov: "Re: how to do very simple animation?"
- Previous message: Peter Foot [MVP]: "Re: text with hyperlink"
- In reply to: Alex Yakhnin [MVP]: "RE: FtpPutFile never timeouts"
- Next in thread: Peter Foot [MVP]: "Re: FtpPutFile never timeouts"
- Reply: Peter Foot [MVP]: "Re: FtpPutFile never timeouts"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|
|