Solved

How can u make events simultaneous?

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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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

Suggested Solutions

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…
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…

828 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