rob05c / gomud

A telnet game server written in Go
MIT License
0 stars 1 forks source link

improve telnet handling #2

Open rob05c opened 11 years ago

rob05c commented 11 years ago

Currently, telnet commands are sent when 3 codes are received. This is insufficient and brittle.

Listeners should forward all telnet command codes to a telnet manager for that connection. The manager should buffer command bytes until a complete command is received, or a new IAC is received.

The telnet manager should also be able to take over listening to handle advanced telnet options which involve messages without the command bit set. Alternatively, the telnet manager could be able to request non-command bytes.

Due to concurrency, the listener may process necessary non-command bytes before it receives the divert message from the telnet manager. Because of this, the manager may not be able to run concurrently with the listener.

Messages sent to clients must also go through a telnet handler. E.g. compression, encryption.