Re: [twsocket] Best event to start new Smtp session

2006-07-30 Thread DZ-Jay
On Jul 30, 2006, at 12:26, Max Terentiev wrote: > My program MUST call Abort() because it's email checker. It's interrupt > connection after Success of RCPT command. DO NOT call Abort(), call QUIT!! Then OnRequestDone is triggered when it finishes and the connection is closed cleanly. Abort()

Re: [twsocket] Best event to start new Smtp session

2006-07-30 Thread Francois PIETTE
> It's NOT possible to use OnRequestDone in case of Smtp->Abort() because > it's NOT triggered for Abort() :-) If (to be verifyed) it is not triggered for Abort(), you can your OnRequestDone handler directly or thru a custom message. > My program MUST call Abort() because it's email checker. It'

Re: [twsocket] Best event to start new Smtp session

2006-07-30 Thread Max Terentiev
Helo Francois, >> Because it's looks like a serious bug. > > Then you have a serious opportunity to dig into the component code :-) > Seriously, don't use OnSessionClosed to start a new SMTP session (subject > of > your message). Use OnrequestDone to do almost everything ! It's NOT possible to u

Re: [twsocket] Best event to start new Smtp session

2006-07-30 Thread Francois PIETTE
> Because it's looks like a serious bug. Then you have a serious opportunity to dig into the component code :-) Seriously, don't use OnSessionClosed to start a new SMTP session (subject of your message). Use OnrequestDone to do almost everything ! -- Contribute to the SSL Effort. Visit http://ww

Re: [twsocket] Best event to start new Smtp session

2006-07-30 Thread Wilfried Mestdagh
Hello Francois, > I'm not sure. Abort is probably a synchronous method. If not, you'll get an > OnRequestDone event. I think it is closing and returning without firing event. It is long ago I checked this... --- Rgds, Wilfried [TeamICS] http://www.overbyte.be/eng/overbyte/teamics.html http://www

Re: [twsocket] Best event to start new Smtp session

2006-07-30 Thread Max Terentiev
Hello Francois, I don't use Application->ProcessMessages in entire application. If event OnSessionClose may trigger (or may not trigger) twice maybe these checks should be implemented inside SmtpCli component ? Because it's looks like a serious bug. --- With best regards, Max Terentiev. Business

Re: [twsocket] Best event to start new Smtp session

2006-07-30 Thread Wilfried Mestdagh
Hello Max, I just checked a few projects of me where I use TSmtpCli. I use OnSessionClosed only for logging purposes. So you dont need it. As DZ mentioned is that the reason wy you call Abort ? Then maybe it is better to follow his Reset advice. --- Rgds, Wilfried [TeamICS] http://www.overbyte.b

Re: [twsocket] Best event to start new Smtp session

2006-07-30 Thread DZ-Jay
Saturday, July 29, 2006, 11:48, Max Terentiev wrote: > Helo, > > What is a best event for starting new Smtp session (e.g. > start sending next message after previous is sent or aborted)? Use OnRequestDone(). Check from there if the request was Abort. What I do is that I build a state machine in

Re: [twsocket] Best event to start new Smtp session

2006-07-30 Thread Francois PIETTE
> Please tell me: HOW i can be 100% sure that Connection is closed, > Component > is ready and i can start new Session ? How to avoid wrong OnSessionClose ? You either have a look at the component source code and try to understand why there are two OnSessionClosed events, or you use a flag to re

Re: [twsocket] Best event to start new Smtp session

2006-07-30 Thread Max Terentiev
Hello Wilfred, I try to post message inside OnSessionClosed... But I notice another problem: I don't know why but OnSessionClosed called twice in some cases ! This is a log of my Smtp session where you can see SmtpCli bug: Here is first session, it's sucessfully completed: - Che

Re: [twsocket] Best event to start new Smtp session

2006-07-30 Thread DZ-Jay
On Jul 30, 2006, at 04:39, Francois PIETTE wrote: >> But how I can detect that SmtpCli->Abort() is finished, component is >> ready and I can call SmtpCli->Connect again for next message ? >> >> If I call SmtpCli->Connect() IMMEDIATELY after SmtpCli->Abort() >> I should receive "Component Not Read

Re: [twsocket] Best event to start new Smtp session

2006-07-30 Thread Francois PIETTE
> But how I can detect that SmtpCli->Abort() is finished, component is > ready and I can call SmtpCli->Connect again for next message ? > > If I call SmtpCli->Connect() IMMEDIATELY after SmtpCli->Abort() > I should receive "Component Not Ready" error, right ? I'm not sure. Abort is probably a sync

Re: [twsocket] Best event to start new Smtp session

2006-07-30 Thread Max Terentiev
Hello Wilfred, But how I can detect that SmtpCli->Abort() is finished, component is ready and I can call SmtpCli->Connect again for next message ? If I call SmtpCli->Connect() IMMEDIATELY after SmtpCli->Abort() I should receive "Component Not Ready" error, right ? If SmtpCli->Abort() is called o

Re: [twsocket] Best event to start new Smtp session

2006-07-30 Thread Wilfried Mestdagh
Hello Max, it has been a while I worked with TSmtpCli. Try to post a message from OnSessionClosed to custom message handler. The message hander take car of next connection. --- Rgds, Wilfried [TeamICS] http://www.overbyte.be/eng/overbyte/teamics.html http://www.mestdagh.biz Saturday, July 29, 20

Re: [twsocket] HttpClient inside HttpServer

2006-07-30 Thread Wilfried Mestdagh
Hello, You can put it in the Tag property if you cast it to an integer. Later in OnDocDone or whatever you restore it back by typecasting to THttpConnection. Dont forget to make it null when the connection is gone. --- Rgds, Wilfried [TeamICS] http://www.overbyte.be/eng/overbyte/teamics.html http

Re: [twsocket] HTTP/1.1 pipelining--any need?

2006-07-30 Thread Francois PIETTE
> As Piotr explained, there is no need for threads--it could all be async! > In > the THttpConnectıonö we need a dynamıc array of requests and when they are > storedö we answer them one by one. This is good for static pages located on the same device. Using multithreaded pipeline will drasticaly

Re: [twsocket] HttpClient inside HttpServer

2006-07-30 Thread Francois PIETTE
> Inside a THttpServer.OnGetDocument event, I have been using several > THttpCli > objects sucessfully for quite a while using Get. As my data returned is > growing every month, i would like to start using GetAsync. > The problem i have is, my data is returned in THttpCli.OnDocDone & i am > unable