Solved

Using HTTPRIO like Ajax

Posted on 2006-11-02
1
699 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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
How to run this video in webbrowse ? 2 68
Print Graphic and Text to Epson TM-T88v 12 113
LAN or WAN ? 11 59
creating threads in delphi 1 53
The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
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, fr…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

708 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

15 Experts available now in Live!

Get 1:1 Help Now