Re: [twsocket] TWSocket Digest, Vol 199, Issue 2 (Aleksey Potjomkin)
Aleksey, Create multiple FTP components, assign them the same event handlers. for I := 1 to 10 do begin Ftp := TFtpClient.Create(nil); [..] Ftp.OnRequestDone := FtpRequestDone; List.Add(Ftp); end; Cast the Sender that is available in any event handler like: procedure TForm1.FtpRequestDone(Sender: TObject; RqType: TFtpRequest; ErrCode: Word); begin case RqType of ftpOpenAsync : TFtpClient(Sender).UserAsync; .. end; --- Arno Garrels [TeamICS] http://www.overbyte.be/eng/overbyte/teamics.html --- Arno Garrels [TeamICS] http://www.overbyte.be/eng/overbyte/teamics.html Aleksey Potjomkin wrote: > Hello ! > >> just download the ics v5 and then have a look in de ics/internet > directory > > OK, I did. But i'm still can't understand main point of it. How to > handle concurrent connections ??? As I understood, main feature of it > is event "OnRequestDone" and there I can make a switch: > " case RqType of > ftpOpenAsync: //.. > ftpUserAsync://.. > ftpPassAsync: //.. > ftpCwdAsync: //.. > ftpTypeSetAsync: //.. > ftpGetAsync: //.. > ftpQuitAsync://.. > " > Something like that. But anyways, it's only about 1 connection at the > same time. For example i have on my form "TFTPCli" component named > "FTP". So how I can open 2 connections at the same time ??? It will > be the same as with synchronous sockets. First i need to work out 1st > connection and only then work with other one. > For example: > " > FTP->HostName = "myhost1.com"; > FTP->User = "user1"; > FTP->Pass = "pass1"; > > FTP->OpenAsync; > > // now OnRequestDone event: > { > switch(RqType): > case ftpOpenAsync: FTP->UserAsync; > case ftpUserAync: FTP->PassAsync; > case ftpPassAsync: // ... > } > " > So only after this connection with worked out i can take another > one, right ? Because if i type: > " > FTP->HostName = "myhost1.com"; > FTP->User = "user1"; > FTP->Pass = "pass1"; > > FTP->OpenAsync; > > FTP->HostName = "myhost2.com"; > FTP->User = "user2"; > FTP->Pass = "pass2"; > > FTP->OpenAsync; > " > User & pass are changed now (if first one isn't done still), so > that will be all wrong. That means I can't work with 2 connections at > once. That's why i used threads. So what you can advice me to do with > all that ? Or maybe I'm not understanding something ? > > > Aleksey > > _ > Express yourself instantly with MSN Messenger! Download today it's > FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ -- To unsubscribe or change your settings for TWSocket mailing list please goto http://www.elists.org/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
Re: [twsocket] TWSocket Digest, Vol 199, Issue 2 (Aleksey Potjomkin)
- Original Message - From: "Aleksey Potjomkin" <[EMAIL PROTECTED]> To: Sent: Tuesday, December 12, 2006 10:36 PM Subject: Re: [twsocket] TWSocket Digest, Vol 199, Issue 2 (Aleksey Potjomkin) > Hello ! > > > just download the ics v5 and then have a look in de ics/internet > directory > > OK, I did. But i'm still can't understand main point of it. How to handle > concurrent connections ??? As I understood, main feature of it is event > "OnRequestDone" and there I can make a switch: just create some more ftp's components or maybe as many needed. Have a look at the httpasy project for some nice idea's :-) -- To unsubscribe or change your settings for TWSocket mailing list please goto http://www.elists.org/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
Re: [twsocket] TWSocket Digest, Vol 199, Issue 2 (Aleksey Potjomkin)
Hello ! > just download the ics v5 and then have a look in de ics/internet directory OK, I did. But i'm still can't understand main point of it. How to handle concurrent connections ??? As I understood, main feature of it is event "OnRequestDone" and there I can make a switch: " case RqType of ftpOpenAsync: //.. ftpUserAsync://.. ftpPassAsync: //.. ftpCwdAsync: //.. ftpTypeSetAsync: //.. ftpGetAsync: //.. ftpQuitAsync://.. " Something like that. But anyways, it's only about 1 connection at the same time. For example i have on my form "TFTPCli" component named "FTP". So how I can open 2 connections at the same time ??? It will be the same as with synchronous sockets. First i need to work out 1st connection and only then work with other one. For example: " FTP->HostName = "myhost1.com"; FTP->User = "user1"; FTP->Pass = "pass1"; FTP->OpenAsync; // now OnRequestDone event: { switch(RqType): case ftpOpenAsync: FTP->UserAsync; case ftpUserAync: FTP->PassAsync; case ftpPassAsync: // ... } " So only after this connection with worked out i can take another one, right ? Because if i type: " FTP->HostName = "myhost1.com"; FTP->User = "user1"; FTP->Pass = "pass1"; FTP->OpenAsync; FTP->HostName = "myhost2.com"; FTP->User = "user2"; FTP->Pass = "pass2"; FTP->OpenAsync; " User & pass are changed now (if first one isn't done still), so that will be all wrong. That means I can't work with 2 connections at once. That's why i used threads. So what you can advice me to do with all that ? Or maybe I'm not understanding something ? Aleksey _ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ -- To unsubscribe or change your settings for TWSocket mailing list please goto http://www.elists.org/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
Re: [twsocket] TWSocket Digest, Vol 199, Issue 2 (Aleksey Potjomkin)
> >For your next message, be sure to use a proper subject. Using a proper > >subject enhance your chances to get an answer. > > Is it OK now ? Not, it isn't. If you reply to a digest mode, change the subject line from "TWSocket Digest..." to the original subject of the message you reply to (A digest message is a collection of messages and you really reply to only one at a time). Maybe you should turn digect mode off. This way it is much easier to reply to messages. And you receive the messages much more quickly along the day. > >Have a look at FtpAsy sample program (In ICS-V5 but also good for V6 > >provided you change the uses clause). > > Sorry, but i couldn't find any such sample as in ICS archive, same not at > your website (User made section). Can you please give me exact way where > to > get this sample ? > > >You may also have a look at the MailSndAsync demo of V5, it's SMTP but > > Same problem as with FtpAsy, i can't find that anywhere. It is simply located in ICS.ZIP ! You probably already have it on your system if you are using ICS-V5. If not, download ICS-V5. -- Contribute to the SSL Effort. Visit http://www.overbyte.be/eng/ssl.html -- [EMAIL PROTECTED] http://www.overbyte.be -- To unsubscribe or change your settings for TWSocket mailing list please goto http://www.elists.org/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
Re: [twsocket] TWSocket Digest, Vol 199, Issue 2 (Aleksey Potjomkin)
> >For your next message, be sure to use a proper subject. Using a proper > >subject enhance your chances to get an answer. > Is it OK now ? Hi Aleksey! I'm also new to this but I think what Francois meant was that You should _continue_ to use the subject that describes the contents of the thread You are answering. It makes it easier for everyone to follow the thread and se what it is about. I don't use Digest mode but as I have understood it You get one mail with a "standard subject" describing what volume and issue it is and the separate messages attached as separate files. I think You should not answer that mail directly (at least not without replacing its subject first...) Instead I think You can open the attached message You want to send an answer to and reply to that one. (If You use non Digest mode every message arrives separately and You can answer them directly.) Well I don't know if that explained anything but I gave it a try :-) Regards Henrik -- To unsubscribe or change your settings for TWSocket mailing list please goto http://www.elists.org/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
Re: [twsocket] TWSocket Digest, Vol 199, Issue 2 (Aleksey Potjomkin)
> > >Have a look at FtpAsy sample program (In ICS-V5 but also good for V6 > >provided you change the uses clause). > > Sorry, but i couldn't find any such sample as in ICS archive, same not at > your website (User made section). Can you please give me exact way where > to > get this sample ? > > >You may also have a look at the MailSndAsync demo of V5, it's SMTP but > > Same problem as with FtpAsy, i can't find that anywhere. > just download the ics v5 and then have a look in de ics/internet directory -- To unsubscribe or change your settings for TWSocket mailing list please goto http://www.elists.org/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
Re: [twsocket] TWSocket Digest, Vol 199, Issue 2 (Aleksey Potjomkin)
Hello ! >For your next message, be sure to use a proper subject. Using a proper >subject enhance your chances to get an answer. Is it OK now ? >Have a look at FtpAsy sample program (In ICS-V5 but also good for V6 >provided you change the uses clause). Sorry, but i couldn't find any such sample as in ICS archive, same not at your website (User made section). Can you please give me exact way where to get this sample ? >You may also have a look at the MailSndAsync demo of V5, it's SMTP but Same problem as with FtpAsy, i can't find that anywhere. Aleksey Potjomkin _ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ -- To unsubscribe or change your settings for TWSocket mailing list please goto http://www.elists.org/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be