Re: [twsocket] HTTP/1.1 pipelining--any need?
The ICSHTTP-server already have support for pipelining as long as you are only serving static files. But if processing a request requires dataprocessing in another thread, the responses might be answered in the wrong order. I put responses and requests in a list and make sure the reponse to be sent is the correct one, if not - wait for the correct one being finished and then send all responses ready for sending. I know Apache support pipelining, at least if you are only getting static files, but I have not yet seen browsers that use pipelining. Regards Bjørnar -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Francois PIETTE Sent: 30. juli 2006 10:03 To: ICS support mailing Subject: Re: [twsocket] HTTP/1.1 pipelining--any need? 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 reduce overall execution time when talking about dynamic pages which - for example - involves querying a database or similar blocking resources (anything which is I/O bound will benefit). Let's take a simple example: Assumin a client sending two pipelined requests for dynamic page. Building a dynamic page require accessing a database located on a dedicated server, accessing a few static files and some processing to build the actual page. In a single threaded piplined operation, everything is done sequenced. In a multithreaded pipeline operation, while a multithreaded approach will have processing for one request while the other is waiting for is database or file access. Overall time is shorter, there is a better CPU usage. Without mention the time shortening if the server is a multiprocessor. Conclusion: as always, multithreading is not mandatory but _may_ help optimize overall performance. If badly used, it may also very well lower performance. And in any case it _will_ lower performance for a single request. -- 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 -- 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] Very strange problem with server and client software [thanks]...
Hello. Just wanted to say thanks for the great input over the weekend! I will consider the input. Francois, you are right, that particular part of the initial handshaking exchange probably is a flaw in the implementation, although it is a requirement in the protocol design. In the protocol design, it is not possible to prepare the CHANNEL before sending the packet, as modifying the channel parameters before the Client is ready will result in a garbled reception by the Client. The packet buffering to prepare the packet before re-syncing the channel works fine. That is the only place in the protocol design where that is a weakness. Every other packet exchange is basically non-modal and can occur in any random or unpredictable order. I guess I assumed that because I was not RECEIVING multi-threaded, or calling any message processing loops, or implementing any custom message pumps, that I wouldn't experience a sequencing issue of that nature. Obviously, I was wrong. :-) Thanks again. Hoby -- 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] Best event to start new Smtp session
Helo Francois, Helo Wilfred, I was try to use Quit instead Abort but Smtp component not ready error is still happens time to time. - I use OnRequestDone to start new session - I don't use Application-ProcessMessages - I only call Smtp-Abort in case of TimeOut. - I use SmtpCli-Quit to terminate connection I notice it almost always happens after bad SmtpCli-Connect attempt: I receive SmtpRequestDone with error 10044 (Interrupted System Call), then i PostMessage to initiate new Session, after receiving message by my messages Handler i call SmtpCli-Connect for next session and receive Smtp component not ready. Please note: it's NOT happens after EACH 10004 error ! It's may be thousands connect attempts before execption throwed. Please ! Help me ! HOW I CAN BE 100% SURE that component is ready for next session ? It's looks like very serious bug inside WSocket and/or SmtpCli. You should agree: component MUST provide relaible event for starting next connects ! Absolutely relabile event ! At this time it's not available: - OnSessionClose may trigger more than one time - OnStateChange is for logging only - OnRequestDone may show Component not ready error. --- With best regards, Max Terentiev. Business Software Products. AMS Development Team. [EMAIL PROTECTED] - Original Message - From: Francois PIETTE [EMAIL PROTECTED] To: ICS support mailing twsocket@elists.org Sent: Sunday, July 30, 2006 8:47 PM Subject: Re: [twsocket] Best event to start new Smtp session 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's interrupt connection after Success of RCPT command. Why Abort ? Just call Quit() which is the proper way of terminating work. If Quit() is not what you need, you may call CtrlSocket.Shutdown(1); to close the underlaying socket gracefully. Calling Abort is for emergency case, it break the connection without the remote party agreeing (it receive EConnReset error). -- Contribute to the SSL Effort. Visit http://www.overbyte.be/eng/ssl.html -- [EMAIL PROTECTED] http://www.overbyte.be - Original Message - From: Max Terentiev [EMAIL PROTECTED] To: ICS support mailing twsocket@elists.org Sent: Sunday, July 30, 2006 6:26 PM Subject: Re: [twsocket] Best event to start new Smtp session 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 use OnRequestDone in case of Smtp-Abort() because it's NOT triggered for Abort() :-) Only OnSessionClosed triggered for Abort() but it's buggy because may trigger more than one time ! My program MUST call Abort() because it's email checker. It's interrupt connection after Success of RCPT command. I'll try to dig code of cource... But it's may to dificult to find random bug in these large library :-) -- Contribute to the SSL Effort. Visit http://www.overbyte.be/eng/ssl.html -- [EMAIL PROTECTED] http://www.overbyte.be - Original Message - From: Max Terentiev [EMAIL PROTECTED] To: ICS support mailing twsocket@elists.org Sent: Sunday, July 30, 2006 5:17 PM Subject: Re: [twsocket] Best event to start new Smtp session 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 Software Products. AMS Development Team. [EMAIL PROTECTED] - Original Message - From: Francois PIETTE [EMAIL PROTECTED] To: ICS support mailing twsocket@elists.org Sent: Sunday, July 30, 2006 6:24 PM Subject: Re: [twsocket] Best event to start new Smtp session 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 remember you already received OnSessionClosed and have to ignore the second one. Note that strange event ordering are frequently resulting from calling the message pump directly or indirectly from one of the events. And indirect message pump call occur in each modal window (frequently used to display values when debugging: don't do that). -- Contribute to the SSL Effort. Visit http://www.overbyte.be/eng/ssl.html -- [EMAIL PROTECTED] http://www.overbyte.be - Original Message - From: Max Terentiev [EMAIL
Re: [twsocket] Best event to start new Smtp session
Max Terentiev wrote: Helo Francois, Helo Wilfred, I was try to use Quit instead Abort but Smtp component not ready error is still happens time to time. I personally haven't noticed this problem (but that must not mean that it doesn't exist). BTW: smtpQuit just sends command Quit to the server. OnSessionClosed will be triggered later when the _server_ closes the connection. However Abort plus posting a custom message should work. Providing a simple test project that reproduces the error might help. A tester should be able to get that running within 5 minutes max. Just upload the test project to a website and post the link here. --- Arno Garrels [TeamICS] http://www.overbyte.be/eng/overbyte/teamics.html - I use OnRequestDone to start new session - I don't use Application-ProcessMessages - I only call Smtp-Abort in case of TimeOut. - I use SmtpCli-Quit to terminate connection I notice it almost always happens after bad SmtpCli-Connect attempt: I receive SmtpRequestDone with error 10044 (Interrupted System Call), then i PostMessage to initiate new Session, after receiving message by my messages Handler i call SmtpCli-Connect for next session and receive Smtp component not ready. Please note: it's NOT happens after EACH 10004 error ! It's may be thousands connect attempts before execption throwed. Please ! Help me ! HOW I CAN BE 100% SURE that component is ready for next session ? It's looks like very serious bug inside WSocket and/or SmtpCli. You should agree: component MUST provide relaible event for starting next connects ! Absolutely relabile event ! At this time it's not available: - OnSessionClose may trigger more than one time - OnStateChange is for logging only - OnRequestDone may show Component not ready error. --- With best regards, Max Terentiev. Business Software Products. AMS Development Team. [EMAIL PROTECTED] - Original Message - From: Francois PIETTE [EMAIL PROTECTED] To: ICS support mailing twsocket@elists.org Sent: Sunday, July 30, 2006 8:47 PM Subject: Re: [twsocket] Best event to start new Smtp session 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's interrupt connection after Success of RCPT command. Why Abort ? Just call Quit() which is the proper way of terminating work. If Quit() is not what you need, you may call CtrlSocket.Shutdown(1); to close the underlaying socket gracefully. Calling Abort is for emergency case, it break the connection without the remote party agreeing (it receive EConnReset error). -- Contribute to the SSL Effort. Visit http://www.overbyte.be/eng/ssl.html -- [EMAIL PROTECTED] http://www.overbyte.be - Original Message - From: Max Terentiev [EMAIL PROTECTED] To: ICS support mailing twsocket@elists.org Sent: Sunday, July 30, 2006 6:26 PM Subject: Re: [twsocket] Best event to start new Smtp session 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 use OnRequestDone in case of Smtp-Abort() because it's NOT triggered for Abort() :-) Only OnSessionClosed triggered for Abort() but it's buggy because may trigger more than one time ! My program MUST call Abort() because it's email checker. It's interrupt connection after Success of RCPT command. I'll try to dig code of cource... But it's may to dificult to find random bug in these large library :-) -- Contribute to the SSL Effort. Visit http://www.overbyte.be/eng/ssl.html -- [EMAIL PROTECTED] http://www.overbyte.be - Original Message - From: Max Terentiev [EMAIL PROTECTED] To: ICS support mailing twsocket@elists.org Sent: Sunday, July 30, 2006 5:17 PM Subject: Re: [twsocket] Best event to start new Smtp session 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 Software Products. AMS Development Team. [EMAIL PROTECTED] - Original Message - From: Francois PIETTE [EMAIL PROTECTED] To: ICS support mailing twsocket@elists.org Sent: Sunday, July 30, 2006 6:24 PM Subject: Re: [twsocket] Best event to start new Smtp session 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
Re: [twsocket] Best event to start new Smtp session
Hello Max, I receive SmtpRequestDone with error 10044 (Interrupted System Call), There must be something wrong in your design to have that error. Are you sure you dont call Abort at the wrong time ? then i PostMessage to initiate new Session, after receiving message by my messages Handler i call SmtpCli-Connect for next session and receive Smtp component not ready. You should first check the state of the component before posting the message. If not ready then OnRequestdone will be fired again when component is ready. - OnSessionClose may trigger more than one time No, it only trigger 1 time. There is something else wrong. Whitch version do you have ? --- Rgds, Wilfried [TeamICS] http://www.overbyte.be/eng/overbyte/teamics.html http://www.mestdagh.biz -- 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