Question on Telnet protocol

GEC: Discuss gaming, computers and electronics and venture into the bizarre world of STGODs.

Moderator: Thanas

Post Reply
User avatar
Yogi
Jedi Council Member
Posts: 2163
Joined: 2002-08-22 03:53pm
Location: Los Angeles
Contact:

Question on Telnet protocol

Post 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?
I am capable of rearranging the fundamental building blocks of the universe in under six seconds. I shelve physics texts under "Fiction" in my personal library! I am grasping the reigns of the universe's carriage, and every morning get up and shout "Giddy up, boy!" You may never grasp the complexities of what I do, but at least have the courtesy to feign something other than slack-jawed oblivion in my presence. I, sir, am a wizard, and I break more natural laws before breakfast than of which you are even aware!

-- Vaarsuvius, from Order of the Stick
nickolay1
Jedi Knight
Posts: 553
Joined: 2005-05-25 12:42am
Location: Marietta, GA

Post 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.
User avatar
sketerpot
Jedi Council Member
Posts: 1723
Joined: 2004-03-06 12:40pm
Location: San Francisco

Post 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.
User avatar
Spacebeard
Padawan Learner
Posts: 473
Joined: 2005-03-21 10:52pm
Location: MD, USA

Post 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.
"This war, all around us, is being fought over the very meanings of words." - Chad, Deus Ex
Post Reply