Solved

Using HTTPRIO like Ajax

Posted on 2006-11-02
1
708 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

739 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