1. commands and code
TRANSMIT-BINARY0
2. Command meaning
* IACWILLTRANSMIT-BINARY
The sender request of this command request starts transmission, or determines that the data to be transmitted will be interpreted in octal binary mode on the receiver.
* Iacwon 'ttransmit-binary
If the connection is already in binary mode, send this command to ask the receiver to restore the original standard nvtascii interpretation data. If it is not yet in binary mode, the sender rejects the transfer and the recipient interprets it as a binary data character (that is, the data transmitter requires that the data be transmitted in the current mode ). Binary transmission is possible only when both parties agree.
* IACDOTRANSMIT-BINARY
The sender requests that data be transmitted, or determines that the data will be transmitted, which is interpreted as eight-bit binary.
* Iacdon 'ttransmit-binary
If it is in binary state, the command sender requires the data sender to transmit standard ntvascii. If the connection is not in the binary state, the sender requires the data sender to send data in the current state. Binary transmission is possible only when both parties agree.
3. Default
The default values are won 'ttransmit-binary and Don 'ttransmit-binary. The connection is not in the binary state.
4. reasons why the option appears
Sometimes binary transmission over Telnet is more efficient, which is the root cause. As long as the two parties change the data interpretation method, this option can be completed, so it is more convenient.
5. Option description
After binary transmission is started, the receiver interprets data that does not start with IAC in binary format. The standard Telnet command is followed by the IAC. If the command after IAC is not recognizable, it works the same as the iacnop command.
6. Implementation problems
It is foreseeable that binary transmission cannot be performed in other modes. However, if both parties can understand that they are in binary transmission mode or, for example, they are in echo mode, there will be no problem if they negotiate on this.
We can see the meaning of the above command. We can note that the meaning of won't and don't depends on whether it is in binary transmission mode. If it is in ebcdic mode, and one side does not know any binary transfer command, if it receives the DOTRANSMIT-BINARY, it does not know what it is, so it returns won 'ttransmit-binary, if the default value for Won 'ttransmit-binary is nvtascii, the sender DOTRANSMIT-BINARY may want the receiver to go to nvtascii, but the recipient may not.
Therefore, we have a rule that when the connection is not in binary state, the default value (that is, the interpretation of won't and don't) is to maintain the status quo, whether in nvtascii, ebcdic or other status. However, when the connection is in the binary state, this rule will not be used. This requires that the connected parties maintain a stack that saves all available connection statuses so that won't and don't can be correctly interpreted. In the binary state, won't and don't will return the nvtascii status.
Because telnet is a two-way channel, you must ensure that the two-way data streams are binary. This rule is described in the Telnet protocol. Let's take a look at the situation of starting or receiving binary transmission from a process and terminal:
A. binary transmission starts from the terminal.
The Implementer should consider how to generate 8-bit valid data in the binary state, without any such check bit.
B. Binary transfer to process
The Implementer should consider how to receive all binary data in the binary state. For example, tops-20 will explain some specific characters at the terminal level (for example, etx, interrupt control-C) without transmitting them to the process.
C. binary transmission starting from the process
The Implementer should consider how the transmitted characters are not interpreted as other characters on the recipient's terminal. For example, tops-20 converts non-printable characters into an arrow and a printable character.
D. Transfer binary data to the terminal
The Implementer should consider how the received data is transmitted to the local terminal. Including some local characters, verification operations or character conversion.
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.