ftp server and client (C windows) using a UDP socket.
The server puts files on the client using CFtpConnection::PutFile
A large file takes several minutes, so the client needs to be able to cancel PutFile().
How do I check for a cancel udp message if PutFile() is busy transferring data? Create another thread….?
Any advice in the right direction is appreciated, thank you.
Since you need some level of control for the transfer process, you can’t go with the high-level approach of
PutFileand you ‘ll have to take a more direct role.Open the remote file with
CFtpConnection::OpenFilefor writing, which will give you aCInternetFile*. You would then write data usingCInternetFile::Writeby yourself; this will also give you the option to stop sending data and close the connection at any time.This page of WinInet documentation mentions a HOWTO and a sample in the MS Knowledge Base, which might be good to look into for an implementation.