Solved

How can u make events simultaneous?

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

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

Title # Comments Views Activity
automatically logging in via bde delphi 3 70
code issue 8 100
Controlled Assessment GCSE - desperate help needed 4 75
Delphi: Connect to running MS Outlook 4 48
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
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 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.
As a trusted technology advisor to your customers you are likely getting the daily question of, ‘should I put this in the cloud?’ As customer demands for cloud services increases, companies will see a shift from traditional buying patterns to new…

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