Skip to main content

5. Description of the Option

Use of the option requires two phases. In the first phase, the telnet processes agree that one of them will TOGGLE-FLOW-CONTROL. WILL and DO are used only in this first phase. In general there will be only one exchange of WILL and DO for a session. Subnegotiations must not be issued until DO and WILL have been exchanged. It is permissible for either side to turn off the option by sending a WONT or DONT. Should this happen, no more subnegotiations may be sent, unless the option is re-enabled by another exchange of DO and WILL.

Once the hosts have exchanged a WILL and a DO, the sender of the DO TOGGLE-FLOW-CONTROL is free to send subnegotiations to enable and disable flow control in the other process, and to send subnegotiations for recommendations on when to restart output. Normally, the sender of the DO will be a host, and the other end will be a user telnet process, which is connected to a terminal. Thus the protocol is normally asymmetric, however it may be used in both directions without confusion should need for this arise.

As soon as the DO and WILL have been exchanged, the sender of the WILL must enable flow control. This allows flow control to begin in a known state. The decision of whether to restart output only when the XON character is received, or when any character received, starts in a system dependent state. (This is to make it consistent with older implementations of the TOGGLE-FLOW-CONTROL option that do not understand the RESTART-ANY and RESTART-XON suboptions.) The sender of the DO should send either a RESTART-ANY or RESTART-XON suboption to put the restart characteristics to a know state. Some clients might not be able to support both of the RESTART-ANY and RESTART-XON modes due to system limitations, and would then choose to ignore these commands. There is no way for the server to be notified of this condition, but a client should make every attempt to honor the state requested by the RESTART-ANY and RESTART-XON modes. Should the option be disabled by exchange of DONT and WONT, flow control may revert to an implementation-defined default state. It is not safe to assume that flow control will remain in the state requested by the most recent subnegotiation.

In most implementations of software flow control, when enabled, the XOFF and XON characters are never propagated to the server; they are typically eaten by the terminal driver between the telnet client and the attached terminal. In most implementations that support the RESTART-ANY functionality, the typed character that re-enables the output is not eaten by the terminal driver, unless it is the XON character.

Currently, only four command codes are defined for the subnegotiations: flow control off (code 0), flow control on (code 1), restart output on any character (code 2) and restart output only on XON (code 3). None of these codes requires any additional data, however it is possible that additional commands may be added. Thus subnegotiations having command codes other than those defined in this document should be silently ignored.

This option does not deal with the issue of allowing the DO side of the connection to inform the WILL side which characters should be used for XON and XOFF. That functionality is already supplied by the LINEMODE [1] option.