In my code for telnet client, I want to echo always. So I will send wont echo to the server.
Linux machines obey the command, but windows machines suppress the wont command and send do echo command instead [confirmed from wireshark and GDB].
What could be the possible reason?
If I understand correctly, WILL and WONT indicate the "local" state. If you want the other party to switch to another mode, you have to send a DO or DONT command.
So, I guess you have to sent a "WILL ECHO", and "DONT ECHO" (meaning: I will perform the echo, so you don't have to echo).
Maybe this document will help:
The Q Method of Implementing TELNET Option Negotiation: https://www.rfc-editor.org/rfc/rfc1143