Solved

Using HTTPRIO like Ajax

Posted on 2006-11-02
1
701 Views
Last Modified: 2007-12-19
Hi,

I have,

procedure DoSomething;
var
    HTTPRIO: THTTPRIO;
    Res : TMyClass; // TRemotable
begin
   HTTPRIO := THTTPRIO.Create(AOwner);
   Res := (HTTPRIO as MyWebService).CallSomething;
   // Use Res
end;

1. Now when I call DoSomething the execution will not proceed until the DoSomething has finished. However, I wish it should proceed without waiting for DoSomething to finish.

2. Sometime it will also require to wait until DoSomething has finished.

I understand that this can be accomplished by using Threads. Can someone give me some example / working code for this?

My goal is to improve existing performance, can this approach be helpful? is there any risk with this approch?

Thanks.
0
Comment
Question by:atul_parmar
1 Comment
 
LVL 27

Accepted Solution

by:
BigRat earned 500 total points
ID: 17858140
In actual fact the Windows Socket interface is asynchronous, so one technically does not need threads. If you're interested check out the ICS Suite from Francois Piette (at Torry). But it's usage is not simple, although quite powerful.

The thread approach involves creating a class derived from TThread and overriding the procedure Execute. You simply put your app code in there.

You then create an instance of the thread (normally suspended) set any variables and then call Resume
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
Internet Business Fax to Email Made Easy - With  eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now