Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Indy10 TFTP server in C++ builder 2010

willemkwillemk Member Posts: 1
Having some trouble getting the TFTP server to actually transfer files.
Everything works as it is supposed to, only the client receives an empty file even though the filesize is 4k.
This is the relevant server code:

void __fastcall TForm1::IdTrivialFTPServer1ReadFile(TObject *Sender, UnicodeString &FileName,
const TPeerInfo &PeerInfo, bool &GrantAccess, TStream *&AStream,
bool &FreeStreamOnComplete)
{
TFileStream* FS;
FreeStreamOnComplete = True;
GrantAccess = True;
if (FileExists(FileName)) {
FS = new TFileStream(FileName, fmOpenRead);
AStream = FS;
}
}

the complete event triggers with no error.
inspecting FS shows all properties to be correct, is there something broken in this version with the assignment of streams?
any suggestions welcome thanks....
Sign In or Register to comment.