Solved

How can u make events simultaneous?

Posted on 2002-07-22
4
130 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
Comment Utility
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
Comment Utility
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
Comment Utility
I've answered I think.
0
 
LVL 5

Expert Comment

by:Lukasz Lach
Comment Utility
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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
This video discusses moving either the default database or any database to a new volume.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

772 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

14 Experts available now in Live!

Get 1:1 Help Now