2003/10/25 XON,XOFF, IXANY

Rapidly fading from having any importance to the average user, these have to do with software flow control. This was once very important for terminal users, and still does have importance for any serial device you may be using (printer, bar code reader, etc.).

Flow control in general is how a device receiving data tells the sending device "Hold on - I can't take any more just now", because its receive buffer is full and the data is coming faster than it can process it.

Hardware flow control is setting voltage levels on wires to say "Stop" and "OK to send". As there are more than a few possibilities as to which pins are used, setting hardware flow control can be more difficult. Software flow control is simple: Control-S means stop, and Control-Q (ar anything at all, if IXANY is set) means it's OK to send more. However, hardware flow control is more reliable and more apt to be acted on quickly.

You set ixon to tell a sending device that it should stop sending when it sees Control-S, and ixoff when you want a receiving device to send the same. Stty would also let you set the start and stop codes to something different than Control-S/control-Q but those are what is normally used.

The whole point of flow control is that data can arrive more quickly than it can be processed. If a serial printer can only out put 100cps, sending it data at 9600 baud means that it is accepting almost 10 times as much data as it can print. Once its buffer fills up, it has to be able to tell the sending system to hold up while it clears away some of that. If not, data will be lost.

Another way to deal with that problem is simply to lower the baud rate: if the printer can only do 100cps, sending the data at 1200 baud is still faster than it can print, though only slightly so, and with the help of its buffer and relatively short print jobs, it might just keep up.

Got something to add? Send me email.

1 comment

Increase ad revenue 50-250% with Ezoic

More Articles by

Find me on Google+

© Tony Lawrence

Thu Feb 25 13:43:28 2010: 8138   anonymous


Still relevant for people wanting to bind Ctrl+S in Vim! I'll use stty -ixon -ixoff.


Kerio Samepage

Have you tried Searching this site?

Support Rates

This is a Unix/Linux resource website. It contains technical articles about Unix, Linux and general computing related subjects, opinion, news, help files, how-to's, tutorials and more.

Contact us