?
Solved

How can u make events simultaneous?

Posted on 2002-07-22
4
Medium Priority
?
140 Views
Last Modified: 2010-04-04
Hi!  I'm running 1 application with 2 client port, and would like to send a text to the server (using the client ports) simulateously?

Thanks for your reply. =)
0
Comment
Question by:innah23
  • 2
4 Comments
 
LVL 17

Accepted Solution

by:
geobul earned 200 total points
ID: 7168844
Hi,
Use threads.

TMySendThread = class(TThread)
public
 Port: string;
 Text: string;
 procedure Execute; override;
end;

procedure TMySendThread.Execute;
begin
  FreeOnTerminate := True;
  // send the text here using Port and Text properties of the thread
end;

MySendThread1, MySendThread2: TMySendThread;

..
MySendThread1 := TMySendThread.Create(true); // create suspended
MySendThread1.Port := '...';
MySendThread1.Text := '...';
// repeat the previous three lines for the second thread with different port and text
...
MySendThread1.Resume; // run the thread 1
MySendThread2.Resume; // run the thread 2

Regards, Geo
0
 

Expert Comment

by:CleanupPing
ID: 9343018
innah23:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
0
 
LVL 17

Expert Comment

by:geobul
ID: 9361389
I've answered I think.
0
 
LVL 5

Expert Comment

by:Lukasz Lach
ID: 9461379
innah23,
No comment has been added lately (15 days), so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area for this question:

RECOMMENDATION: Award points to geobul http:#7168844

Please leave any comments here within 7 days.

-- Please DO NOT accept this comment as an answer ! --

Thanks,

anAKiN
EE Cleanup Volunteer
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

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…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Suggested Courses
Course of the Month14 days, 16 hours left to enroll

840 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