A GUI is a user interface. Its purpose is to provide interaction between the
user and the application. It is not intended to *do* any work, but should
provide an interface to the objects that do the work. So, first of all, your
GUI should not be trying to open a Socket or send anything. It should only
instruct the business object(s) to do so. It is also single-threaded.
Once you've separated the User Interface from the business classes, it's a
relatively simple matter for your business classes to run the Socket process
in a separate thread.
--
HTH,
Kevin Spencer
Microsoft MVP
Printing Components, Email Components,
FTP Client Classes, Enhanced Data Controls, much more.
DSI PrintManager, Miradyne Component Libraries:
http://www.miradyne.net
<li*********@yahoo.com.hkwrote in message
news:11*********************@z28g2000prd.googlegro ups.com...
What is the best way to write the following application:
The Main GUI thread will try to send packet to other side in the
network, it could be very slow network or very fast network. How can i
ensure that the sending packet will not miss and the program is
effective?
I tried to use Socket::Send to send data, but if it is in a very slow
network, then it will block the main GUI for responding, right? Then
How can i acheive this purpose?
The packet the program needs to send is about 256kbyte per one and
send in 25 time per seconds.
Thanks