Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!uwm.edu!zaphod.mps.ohio-state.edu!tut.cis.ohio-state.edu!ucbvax!pasteur!helios.ee.lbl.gov!ucsd!hub!engrhub!patrick From: patrick@engrhub.ucsb.edu (Patrick Lindstrom) Newsgroups: comp.os.os2 Subject: Re: Is there a way to peek ahead and see how many bytes are in the COM buffer? Message-ID: <3425@hub.UUCP> Date: 28 Dec 89 22:37:51 GMT References: <1989Dec24.103004.26003@larouch.uucp> Sender: news@hub.UUCP Reply-To: patrick@engrhub.UUCP (Patrick A. Linstruth) Organization: University of California, Santa Barbara Lines: 17 In article <1989Dec24.103004.26003@larouch.uucp> yozzo@larouch.UUCP (Ralph Yozzo) writes: > >Does anyone know of a way to peek ahead and see how many bytes are in >the COM1 buffer? >The reason I ask is that I'd like to read as many bytes >as possible from the COM port and I'd rather >not ask for too much because the DosRead() will block. > Ralph, I have one more suggestion... If you don't want the device driver to block, you can user IOCtl Category 1, Function 53h to set the read mode to no-wait. This will tell the device driver to return with as many characters as are in the receive queue. If there aren't any characters it just returns a byte count of 0. Patrick Linstruth patrick@wongo