Serial I/O

John F Haugh II jfh at rpp386.cactus.org
Tue Dec 11 11:46:32 AEST 1990


In article <1629 at svin02.info.win.tue.nl> debra at svin02.info.win.tue.nl (Paul de Bra) writes:
>In article <1990Nov26.092137.5629 at oilean.uucp> joe at oilean.uucp (Joe McGuckin) writes:
>>I have an application that needs to send/receive stuff from a serial port in
>>an async. manner. I know that Unix's tip forks a seperate processes for sending
>>and receiving chars...
>
>Look at the source for kermit (public domain).
>As far as i know it does everything with only one process.

Ah, but Kermit cheats.  It sends packets and then receives packets - it is 
very much a synchonous protocol.  For async transfers you need something
more clever.

The "real" answer is the use select(), poll() or some combination of
vmin=0/vtime=0 termio magic.  Issue a select() call for all of your fd's
and let the system figure it out ...
-- 
John F. Haugh II                             UUCP: ...!cs.utexas.edu!rpp386!jfh
Ma Bell: (512) 832-8832                           Domain: jfh at rpp386.cactus.org



More information about the Comp.unix.internals mailing list