I am trying to write a simple Telnet server for mIRC by following the original Telnet Protocol RFC, and I need some help...
The Telnet Protocol's RFC says the following:
The telnet protocol also specifies various commands that control the method and various details of the interaction between the client and server. These commands are incorporated within the data stream. The commands are distinguished by the use of various characters with the most significant bit set. Commands are always introduced by a character with the decimal code 255 known as an Interpret as command (IAC) character.
My question is:
How do I send a decimal code using sockets?
Here's the code that I am using to send the (IAC) command:
on *:SOCKLISTEN:telnet:{
sockaccept client
[color:red]sockwrite -n client 255(IAC),251(WILL),3[/color]
}
The problem with the above code is that the '255(IAC),251(WILL),3' is not being interpreted by the Telnet client... Instead, it is appearing on the client terminal as regular text...
What am I doing wrong?