Page 1 of 1
Question on Telnet protocol
Posted: 2005-12-16 08:20pm
by Yogi
I am currently thinking of programming my own MUD (probably no one will play it, but I just want to make sure that having to program in Visual Basic 6 at my job hasn't completely rotted by brain) and I need information on programming the telnet interface. According to wikipedia, the entire Telnet protocol contained in RFC 854 and RFC 855, but there are other extensions out there. Does anyone know how common these extensions are and is there any way to tell if a client uses them or not?
Posted: 2005-12-16 10:38pm
by nickolay1
Telnet is an extremely simple protocol. Whatever they type in gets sent to you, byte by byte (as they're typing). When you send them a plain string, it gets displayed by the telnet client exactly as it was received.
Posted: 2005-12-16 10:55pm
by sketerpot
If you just open a socket and treat it the same way you would treat standard io streams, you should be fine. Be sure to flush after your output.
If there are any extensions, you shouldn't worry about them until after you get the MUD working.
Posted: 2005-12-16 11:15pm
by Spacebeard
nickolay1 wrote:Telnet is an extremely simple protocol. Whatever they type in gets sent to you, byte by byte (as they're typing). When you send them a plain string, it gets displayed by the telnet client exactly as it was received.
The telnet protocol has out-of-band commands and a negotiation phase in which the capabilities of the client and server are compared and a least common denominator is negotiated. See the RFCs referenced by the OP for details, or read the telnet(1) manual page on any UNIX system.
However, most MUDs don't use this protocol. They just send and receive plain text on a TCP socket. They are commonly thought of as using the "telnet protocol" however, because the telnet command is the easiest way to connect to them if you don't use a specialized MUD client. Similarly, the easiest way to send email if you don't use a specialized MUA is to use the telnet command to connect to an SMTP server, but that doesn't mean that the SMTP server uses the telnet protocol.
Honestly, unless the socket handling (and the object model, and the command parser...) is the part you really want to program, I would recommend modifying an existing MUD codebase instead of starting from scratch. I've attempted the same thing you're contemplating on several occasions and never gotten close to finished. Designing and implementing a complex software system like a MUD as a purely solo project is a more difficult job than many people might think, and it's easy to reach a point where you realize you need to rip out everything you've built and start over because it doesn't work with other features you have planned. I wish you luck if you decide to go for it, though.