Newsgroups : Borland : borland.public.delphi.internet.winsock : 2006 Mar : Re: FTP in Thread
| Subject: | Re: FTP in Thread |
| Posted by: | "sham" (shamre..@inspirationmatters.com) |
| Date: | Mon, 10 Apr 2006 20:52:58 |
Hi Guillem,
Thank you very much for trying to help me out.
I have tried passive mode and binding and yet I still have ReadTimeOut
problems.
As I have mentioned in my previous threads, all I have on the server side is
the OnStoreFileEvent.
On the client side, I try to upload 100 files in a loop. That is all.
I have no idea what is causing this problem. Also I do not want to give up
on INDY at this stage.
If you would like to see my code, I can send you the two projects (ftp
server and ftp client) to see if you can help me detect where the problem
is.
Regards
Sham.
"Guillem" <guillemvicens-nospam@clubgreenoasis.com> wrote in message
news:xn0ekti71fpxyt001@newsgroups.borland.com...
> sham wrote:
>
>> Hi Guillem,
>>
>> I removed all the threading code and created two applications, one
>> the FTP Server and the other the FTP Client. I could not get this to
>> work due to the time outs and then sometimes getting the stack dumps
>> that I have shown in previous threads.
>>
>> I am testing locally and have not proxy settings. For authentication,
>> I just code the onauthenticate event and accepted the login.
>
> actually, I was speaking about the value of the AuthCMD property of the
> FTP client. If you don't know what to assign then use tAuto
>
>>
>> So, what am I doing wrong in this simple demo without threads?
>>
>
> you need to have at least 2 event handlers implemented in the
> idFTPServer: the OnRetrieveFile and the OnStoreFile. For example,
>
> procedure TDataModule.IdFTPServerRetrieveFile(ASender:
> TIdFTPServerContext;
> const AFileName: string; var VStream: TStream);
> begin
> VStream := TFileStream.Create(MyFileName, fmOpenRead or
> fmShareExclusive);
> end;
>
> procedure TDataModule.IdFTPServerStoreFile(ASender: TIdFTPServerContext;
> const AFileName: string; AAppend: Boolean; var VStream: TStream);
> begin
> VStream := TFileStream.create(MyFileName, fmCreate or
> fmShareExclusive ) ;
> end;
>
> I guess you did this but the server has also to be active to listen to
> a client and the client's IP+port has to be in the bindings list of the
> server. In local mode you need to have 127.0.0.1 or 0.0.0.0 (which
> means listening to *all* IPs and is really not a good idea)
>
>
> Also take in consideration that FTP is not very firewall-friendly due
> to its need of 2 open connections. Make sure you haven't problems on
> that side, and if you do, consider to use the passive mode (property in
> client by default set to false) instead of active mode. You can find
> more info in RFC959
> --
> Best regards :)
>
> Guillem Vicens Meier
> Dep. Informatica Green Service S.A.
> www.clubgreenoasis.com
> --
> In order to contact me remove the -nospam