Solved

How can u make events simultaneous?

Posted on 2002-07-22
4
133 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 50 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

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

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…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

831 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