sflee
sflee

Reputation: 1719

Why telnet automatically send out commands

I built a server, with TCP socket. I have a client using telnet connected to the server. Once the connection is active, the server will send data to the client.

The problem is that the client will send some commands to the server randomly and automatically, such as:
IAC WONT 64 --- FF FC 40
IAC DONT 64 --- FF FE 40
IAC DO 00 --- FF FD 00
Telnet Command list

My questions:
1. Why will the telnet client send out message to server by itself?
2. What is the meaning of those commands, I cannot find the meaning of 0x40 and 0x00?

Upvotes: 0

Views: 649

Answers (1)

Brian White
Brian White

Reputation: 8736

00 is "binary transmission" meaning that it's an 8-bit connection. 40 is not something that is standardized but whatever it is, the client doesn't want to do it.

Either side of a "telnet" connection can send configuration negotiation options upon establishing the connection (or, though rarely, any time during the session) though typically the client defaults to a "raw socket" until it starts receiving codes from the server so that the program can be used to connect to other, non-telnet ports as well.

You didn't specify what OS you're using but there may be options to telnet that prevent initial option negotiation.

Upvotes: 1

Related Questions