Path: utzoo!censor!geac!torsqnt!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!apple!well!shiva From: shiva@well.sf.ca.us (Kenneth Porter) Newsgroups: comp.os.os2.programmer Subject: Canceling Async Operations Keywords: DosReadAsync DosSemWait cancel COM1 DCBINFO timeout select Message-ID: <21860@well.sf.ca.us> Date: 29 Nov 90 05:58:52 GMT Distribution: comp Lines: 21 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)