XON/XOFF Flow Control

Parent Previous Next

XON/XOFF Flow Control


Most terminals can use the XOFF/XON (transmit off/transmit on) protocol.  This allows both the terminal and the computer to exercise some control over the data they receive by telling the other side when to start and stop transmitting characters.  This is accomplished by sending XOFF (ASCII value 19) to stop the transmission and XON (ASCII value 17) to start it.


Most terminals have input buffers used to store received characters when they are received faster than the terminal can display/print.  Likewise, some computer hardware used to receive terminal input also has a buffer to store received characters until the computer software has a chance to process them.  XON/XOFF is used to prevent these buffers from filling and losing characters. Because hardware buffers tend to be relatively small, UOS also maintains buffers for both input and output to terminals. Thus, UOS will also send XON/XOFF to the terminal as its buffers fill and empty.


XON corresponds to the Control-Q and XOFF corresponds to Control-S.  Because it is impossible for the computer to determine if an XON or XOFF was sent by the terminal hardware or by the user typing Control-Q/S, the user can use these key combinations to manually turn terminal reception of characters on and off.


If the terminal doesn't respond to XON/OFF, any characters received after the UOS input buffer is filled are ignored (lost).  UOS has input flags that can allow UOS to ignore XON/XOFF in terms of flow-control and treat them as normal character input.  Even if the terminal is in binary mode, XON/XOFF is treated as flow-control, unless the ignore-XON/OFF flag is set.


Note that XON/XOFF flow control is one-way, so that transmission can be paused in one direction but not in the other.  Only if both ends (computer and terminal) send XOFF is transmission paused in both directions.