[comp.os.os2.programmer] Canceling Async Operations

shiva@well.sf.ca.us (Kenneth Porter) (11/29/90)

How do I cancel a DosReadAsync()?  Do I have to close the
handle, or is there an easier way?  I want to get the
equivalent effect of the Unix select() call, in which I can
block waiting on either characters available or a timeout.  The
only way I can see to do this is to use DosReadAsync and
DosSemWait, and kill the async thread by closing the device out
from under it.  This is klugy because I have to make the device
name and settings available to the wait-for-character code so
that I can re-open and configure the device.
 
The application will initially use a serial port, so perhaps
the timeout stuff in the DCBINFO can be used, but I need to
change the timeout dynamically, as different timeouts apply
during different phases of the transmission.  Just how does the
timeout stuff in DCBINFO work?
 
I would like to eventually use arbitrary devices so a
device-independent solution is preferable.
 
Ken (shiva@well.sf.ca.us)