🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.internet.socket
Article #1366

Re: Indy 9 TrivialFTP Questions:

#1366
From: Remy Lebeau (TeamB)
Date: Tue, 13 Feb 2007 09:59
34 lines
2338 bytes
"Paul at NCF" <notplmacca@clara.co.uk> wrote in message
news:45d17236@newsgroups.borland.com...

> Is the PUT client operation asyncronous?

No, just like most everything else in Indy.  Put() does not exit until
the transfer is fully completed, or an error occurs.

> I've create a client app and server app, and in my example I
> have the client do two calls for Put, back to back.  On the server,
> the logging shows two Write File events, followed by two transfer
> complete events?

And the problem is...?  That is how it is supposed to work.  When
TIdTrivialFTPServer receives a request for a file, it triggers the
OnReadFile or OnWriteFile event to obtain the appropriate TStream
object for the file, and then reads/writes all of the file data until
finished, at which time the OnTransferComplete event is triggered.

> What type of thread safe access do I need to put in the server event
> handles for read, write, transfer complete (for multiple client
> connections)?

That depends on how you are accessing the local files to begin with.
You have to make sure that you are providing your TStream objects in a
thread-safe manner.  If you have two clients accessing the same file
at the same time, that would be bad.

And in any case, the OnTransferComplete event handler is always
synchronized with the main thread.


Gambit
Technical Details
Message-ID: <45d18c50$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news1.google.com!news.germany.com!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <45cee6cb@newsgroups.borland.com> <45cf9149$1@newsgroups.borland.com> <45d02a9b@newsgroups.borland.com> <45d02e46$1@newsgroups.borland.com> <45d17236@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 11508e,345d5958a6f3add0
X-Google-Attributes: gid11508e,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Remy Lebeau \(TeamB\)" <no.spam@no.spam.com>
Newsgroups: borland.public.cppbuilder.internet.socket
References: <45cee6cb@newsgroups.borland.com> <45cf9149$1@newsgroups.borland.com> <45d02a9b@newsgroups.borland.com> <45d02e46$1@newsgroups.borland.com> <45d17236@newsgroups.borland.com>
Subject: Re: Indy 9 TrivialFTP Questions:
Date: Tue, 13 Feb 2007 01:59:18 -0800
Lines: 36
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1409
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409
NNTP-Posting-Host: 75.83.34.171
Message-ID: <45d18c50$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1171360848 75.83.34.171 (13 Feb 2007 02:00:48 -0800)
Path: arc1-ca.pugleaf.net!g2news2.google.com!news1.google.com!news.germany.com!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail