Skip to main content

How to reallow the request queue

DISCUSSION:

The above rule prevents queueing of more than one request through the network. However, it is possible to queue new requests within the TELNET implementation, so that "option typeahead" is effectively restored.

An obvious possibility is to maintain a list of requests that have been made but not yet sent, so that when one negotiation finishes, the next can be started immediately. So while negotiating for a WILL, TELNET could buffer the user's requests for WONT, then WILL again, then WONT, then WILL, then WONT, as far as desired.

This requires a dynamic and potentially unmanageable buffer. However, the restrictions upon possible requests guarantee that the list of requests must simply alternate between WONT and WILL. It is wasteful to enable an option and then disable it, just to enable it again; we might as well just enable it in the first place. The few possible exceptions to this rule do not outweigh the immense simplification afforded by remembering only the last few entries on the queue.

To be more precise, during a WILL negotiation, the only sensible queues are WONT and WONT WILL, and similarly during a WONT negotiation. In the interest of simplicity, the Q method does not allow the WONT WILL possibility.

We are now left with a queue consisting of either nothing or the opposite of the current negotiation. When we receive a reply to the negotiation, if the queue indicates that the option should be changed, we send the opposite request immediately and empty the queue. Note that this does not conflict with the RFC 854 rule about automatic regeneration of requests, as these new requests are simply the delayed effects of user or process commands.

An implementation SHOULD support the queue, where support is defined by the rules following.

If it does support the queue, and if an option is currently under negotiation, it MUST NOT handle a new request from the user or process to switch the state of that option by sending a new request through the network. Instead, it MUST remember internally that the new request was made.

If the user or process makes a second new request, for switching back again, while the original negotiation is still incomplete, the implementation SHOULD handle the request simply by forgetting the previous one. The third request SHOULD be treated like the first, etc. In any case, these further requests MUST NOT generate immediate requests through the network.

When the option negotiation completes, if the implementation is remembering a request internally, and that request is for the opposite state to the result of the completed negotiation, then the implementation MUST act as if that request had been made after the completion of the negotiation. It SHOULD thus immediately generate a new request through the network.

The implementation MAY provide a method by which support for the queue may be turned off and back on. In this case, it MUST default to having the support turned on. Furthermore, when support is turned off, if the implementation is remembering a new request for an outstanding negotiation, it SHOULD continue remembering and then deal with it at the close of the outstanding negotiation, as if support were still turned on through that point.

DISCUSSION:

It is intended (and it is the author's belief) that this queue system restores the full functionality of TELNET. Dave Borman has provided some informal analysis of this issue [1]; the most important possible problem of note is that certain options which may require buffering could be slowed by the queue. The author believes that network delays caused by buffering are independent of the implementation method used, and that the Q Method does not cause any problems; this is borne out by examples.