Telnet Echo Option

Source: Internet
Author: User

1. 1. Command and code echo12. command significance * iacwillecho command sending...
2. Normally, the connection is bidirectional, and the data stream in one direction has nothing to do with the data stream in another aspect...
3. The Echo Option alone is not enough for remote computers to understand the characters entered on the terminal...

Body content:
Generally, the connection is bidirectional, and the data stream in one direction has nothing to do with the data stream in another aspect. There are five possible situations:

This option determines whether one end returns data from the other end. If the other end is not returned, the system does not return the result.
If both hosts are in the ECHO status, there will be an infinite loop on the connection. Therefore, the implementer must pay attention to this situation during implementation and the data returned by one end, the other end does not return any more.
The default status when both parties establish a connection is not echo.
If one party decides to return the data sent by the other party or wants the other party to do so, it will issue the corresponding command and wait for the response. If the response is rejected, the response is still not in the ECHO State. If the other party accepts the request, the connection enters the echo State. In this state, either party can cancel the echo state, because the connection is bidirectional, different echo states should be released.
In implementation, we must observe the cycle prevention rules in the Telnet protocol. The switch in different States may be meaningless, so pay special attention to the status of the switch. For example, if one party responds to doecho with willecho, all characters After doecho will be returned, which should be kept in mind by both the receiver and the sender.
Generally, the connection is bidirectional, and the data stream in one direction has nothing to do with the data stream in another aspect. There are five possible situations:

This option determines whether one end returns data from the other end. If the other end is not returned, the system does not return the result.
If both hosts are in the ECHO status, there will be an infinite loop on the connection. Therefore, the implementer must pay attention to this situation during implementation and the data returned by one end, the other end does not return any more.
The default status when both parties establish a connection is not echo.
If one party decides to return the data sent by the other party or wants the other party to do so, it will issue the corresponding command and wait for the response. If the response is rejected, the response is still not in the ECHO State. If the other party accepts the request, the connection enters the echo State. In this state, either party can cancel the echo state, because the connection is bidirectional, different echo states should be released.
In implementation, we must observe the cycle prevention rules in the Telnet protocol. The switch in different States may be meaningless, so pay special attention to the status of the switch. For example, if one party responds to doecho with willecho, all characters After doecho will be returned, which should be kept in mind by both the receiver and the sender.
The Echo Option alone is not enough for remote computers to understand the characters entered on the terminal, so the suppress-goahead option should be used for corresponding processing.
6. Example
The following is a simple implementation called uhost. The value used for non-echo is smaller than the value used for ECHO. For each user terminal, the uhost retains three status bits, whether to echo itself, whether the user wants to work in the ECHO State, and whether the terminal is in the ECHO state when connected to the server, these three are called P (physical), D (expected), and a (actual) bits.
When dialing a terminal, P and D are set, while a is set to non-echo. P and D can be set manually through corresponding commands.
When the connection between the uhost and the server is enabled, if the minimum values of the P-bit and D-bit are smaller than the-bit, the doecho command is sent to the server. If the wontecho or willecho response is received, uhost sets a bit to the minimum value of the following three values: received value, P bit value, and D bit value. If you need to change the current status of Bit A, the uhost sends a confirmation message. If the current status of Bit A is not changed, a rejection is returned, indicating that you do not need to change the status.
If the value of P or D is changed on the uhost terminal when the connection is enabled, the uhost will repeat the test above. When the connection is closed, the uhost restores the-bit value. Because the doecho and dontecho commands are not involved when the uhost connection is enabled or when the user explicitly changes the echo status, the large host will perform such status switching frequently. For example, when the line-at-a-time system is running, the server tries to use the wontecho command to set the user to the local ECHO status; however, when the character-at-a-time system is running, the server needs to use the willecho command to start the user's remote echo. In addition, because uhost does not issue the willecho command, it only sends the wontecho command, and the server host frequently sends the will and wont commands.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.