APLawrence.com -  Resources for Unix and Linux Systems, Bloggers and the self-employed

2003/10/25 XON,XOFF, IXANY

© October 2003 Tony Lawrence

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.

(OLDER)    <- More Stuff -> (NEWER)    (NEWEST)   

Printer Friendly Version


1 comment

Inexpensive and informative Apple related e-books:

Take Control of iCloud, Fifth Edition

Take Control of Preview

Take Control of the Mac Command Line with Terminal, Second Edition

Take Control of High Sierra

Take Control of Numbers

More Articles by © 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.



Printer Friendly Version

Have you tried Searching this site?

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

Printer Friendly Version

Microsoft isn't evil, they just make really crappy operating systems. (Linus Torvalds)

Linux posts

Troubleshooting posts

This post tagged:




Unix/Linux Consultants

Skills Tests

Unix/Linux Book Reviews

My Unix/Linux Troubleshooting Book

This site runs on Linode