Hi,
One solution is to use mutlithreading. Lookup beginthreadex, mutexes
WaitForSingleObject etc.
Another solution. When reading from file descriptors sockets you can
use(/abuse) 'select'. The last parameter of select is a timeout value i,e.
Set the timeout to 3 seconds.
If anything is received on the descriptors check the time (you can do
precision timing with the multimedia functions of windows) So you know how
long the next wait should be
Handle the incoming messages
Do an select of the remaining 3 seconds (you can check the return value of
select to know if it returned because of timer expiry)
If return because of 3 second elapse do your '3 second thing'
Ad infinitum
--
Regards, Ron AF Greve
http://moonlit.xs4all.nl
"solarin" <> wrote in message
news: oups.com...
> Im devoloping a simulator for a driver. Every time the simulator
> recieves a frame, it must answer with another. One of these frames,
> forces to use a few variables during 3 seconds. How I should create a 3
> seconds timer? During this time , the simulator and the driver continue
> receiving and sending data of course.
>
> Thanks for your support.
>