[twsocket] How to read directory with ftpclient?

2006-05-17 Thread Dominik Schmidt
Hello, I want to read a directory from my ftp server. So I use this code to read the dir: FTP.DisplayFileFlag:= True; FTP.Passive:= True; FTP.HostDirName:= '/LVsource/'; FTP.HostFileName := '*.*'; DeleteFile(TEMP_FILE_NAME); FTP.LocalFileName :=

[twsocket] application with socks5 support?

2006-05-17 Thread Dominik Schmidt
Hello, in my company we use a socks5 server to connect to special services like ftp. To do this we have a little tool called FreeCAP (http://www.freecap.ru/eng/?p=). I want to add my own socks support in my application but I donĀ“t know how to do that. My application uses ftp and smtp. Both

Re: [twsocket] application with socks5 support?

2006-05-17 Thread Francois Piette
For FTP client component, see ConnectionType property and all properties having socks in their names. The SMTP component has not exposed any socks properties. It has to be modified much like the FTP component (Socks protocol is supported by the TWSocket component used by both FTP and SMTP

[twsocket] thread message loop question

2006-05-17 Thread Carsten Muencheberg
Hi, I am using THttpClient from inside a TThread object for downloading several files sequentially. At present the implementation is synchronous, setting MultiThreaded = true then calling Get(). I noticed a high CPU load while downloading, but I am not sure whether this comes from the download

Re: [twsocket] thread message loop question

2006-05-17 Thread Francois Piette
You have high CPU usage because you use sync methods. Use Async and you'll have the best CPU usage. You probably don't need multithreading at all. The component will download your files in the bacground without using any thread. To have the component work in a thread, you _must_ create it

Re: [twsocket] thread message loop question

2006-05-17 Thread Fastream Technologies
When I was in university back in 1990s, we were taught nothing about messages--only the threads (UNIX style). I think that's what confuses most people with async... I suggest you to add a simple Sleep(1) to the message pump or perhaps use GetMessage instead of PeekMessage. This way both async

Re: [twsocket] thread message loop question

2006-05-17 Thread Arno Garrels
Fastream Technologies wrote: I suggest you to add a simple Sleep(1) to the message pump This would result in very poor performance, it's really not recommended, even though it works ;-) For a simple message loop have a look at CtrlSocket.MessageLoop, it is the built-in message pump that you

Re: [twsocket] thread message loop question

2006-05-17 Thread Fastream Technologies
- Original Message - From: Arno Garrels [EMAIL PROTECTED] To: ICS support mailing twsocket@elists.org Sent: Wednesday, May 17, 2006 5:03 PM Subject: Re: [twsocket] thread message loop question : Fastream Technologies wrote: : : I suggest you to add a simple Sleep(1) to the message

Re: [twsocket] thread message loop question

2006-05-17 Thread Arno Garrels
Fastream Technologies wrote: - Original Message - From: Arno Garrels [EMAIL PROTECTED] To: ICS support mailing twsocket@elists.org Sent: Wednesday, May 17, 2006 5:03 PM Subject: Re: [twsocket] thread message loop question Fastream Technologies wrote: I suggest you to add a

Re: [twsocket] thread message loop question

2006-05-17 Thread Carsten Muencheberg
Fastream Technologies schrieb: - Original Message - From: Arno Garrels [EMAIL PROTECTED] To: ICS support mailing twsocket@elists.org Sent: Wednesday, May 17, 2006 5:03 PM Subject: Re: [twsocket] thread message loop question : Fastream Technologies wrote: : : I suggest you to

Re: [twsocket] thread message loop question

2006-05-17 Thread Fastream Technologies
Strange. I remember the days I wrote NETFile FTP Client which had the same 100% CPU problem that I had to by-pass with the Sleep(1) trick. If it calls Getmessage, why is it 100%? Regards, SZ - Original Message - From: Arno Garrels [EMAIL PROTECTED] To: ICS support mailing

Re: [twsocket] thread message loop question

2006-05-17 Thread Arno Garrels
Carsten Muencheberg wrote: Answering my own question: void __fastcall TForm1::HttpCli1DocData(TObject *Sender, Pointer Buffer, int Len) { Sleep(1); } // --- Did the trick, CPU is at 0% now. :-) Note, that

Re: [twsocket] thread message loop question

2006-05-17 Thread Arno Garrels
Are there any AV scanners running in the background? I saw a lot of troubles with Norton AV. --- Arno Garrels [TeamICS] http://www.overbyte.be/eng/overbyte/teamics.html Arno Garrels wrote: Carsten Muencheberg wrote: Answering my own question: void __fastcall

[twsocket] Closing HttpClients problem

2006-05-17 Thread Paul
Hi, When I close the Httpclients (CloseAsync), I have to wait sometimes for 20 seconds before I can start them again. Is there anything else I shoild do to avoid this problem ? Paul -- To unsubscribe or change your settings for TWSocket mailing list please goto