Article View: borland.public.cppbuilder.internet.socket
Article #1350Indy 9 TrivialFTP Questions:
From: Paul at NCF
Date: Sun, 11 Feb 2007 09:50
Date: Sun, 11 Feb 2007 09:50
67 lines
2906 bytes
2906 bytes
Hi,
I'm trying to get Trivial FTP working and there are a few questions I have:
1) I presume the transfer only uses the standard UDP checksum to check the
integrity of the payload?
2) It cannot continue (resume) from a previous transfer
3) This is a bit of a general question? What is the server bindings
property for, and where can I find more info or examples on its use?
4) I've got a sample server and client working yesterday (local test
127.0.0.1), but I noticed that there seems to be a problem with file access
on the server side when putting files - clicking button 1 twice too quickly.
I figured it must be timing in that the server still has the file open when
the next request comes in for the same file. So I put in a 'delay' by
putting two files instead, and disabled the button whilst doing the puts.
But I still get the exception if I press too quickly after its re-enabled.
Any clues or guidence?
Regards,
Paul
void __fastcall TForm1::Button1Click(TObject *Sender)
{
try
{
CopyFile( "CopyClientFile.Txt", "Client1File.Txt", false );
CopyFile( "CopyClientFile.Txt", "Client2File.Txt", false );
Button1->Enabled = false;
IdTrivialFTP->Put("Client1File.Txt", "Server1File.Txt" );
IdTrivialFTP->Put("Client2File.Txt", "Server2File.Txt" );
Button1->Enabled = true;
}
catch (...)
{
}
}
void __fastcall TForm1::IdTrivialFTPServerWriteFile(TObject *Sender,
AnsiString &FileName, const TPeerInfo &PeerInfo, bool &GrantAccess,
TStream *&AStream, bool &FreeStreamOnComplete)
{
bool freeon = false;
bool access = false;
// [TBD]
// check Peer in known list
// check File access
// etc
access = true;
// set up requirements
if (access)
{
TFileStream * f = new TFileStream(FileName, fmCreate |
fmShareExclusive);
AStream = f;
freeon = true;
}
FreeStreamOnComplete = freeon;
GrantAccess = access;
}
Technical Details
Message-ID:
<45cee6cb@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!homer!news.glorb.com!news-spur1.glorb.com!news.glorb.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Thread: 11508e,345d5958a6f3add0,start X-Google-Attributes: gid11508e,public X-Google-Language: ENGLISH,ASCII-7-bit From: "Paul at NCF" <notplmacca@clara.co.uk> Newsgroups: borland.public.cppbuilder.internet.socket Subject: Indy 9 TrivialFTP Questions: Date: Sun, 11 Feb 2007 09:50:06 -0000 Lines: 69 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.3028 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2900.3028 X-RFC2646: Format=Flowed; Original NNTP-Posting-Host: 81.155.185.142 Message-ID: <45cee6cb@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1171187403 81.155.185.142 (11 Feb 2007 01:50:03 -0800) Path: arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!homer!news.glorb.com!news-spur1.glorb.com!news.glorb.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail