unitopia-de / webmud3

Webmud3: third generation of the UNItopia Webmud as open source project.
GNU General Public License v3.0
8 stars 3 forks source link

Implement Telnet EOR Option (End of Record) #112

Open myonara opened 3 months ago

myonara commented 3 months ago

Description: Implement support for the Telnet EOR (End of Record) option to allow structured data segmentation in the communication stream. The EOR option is used to mark the end of a logical data "record" or unit, which is useful in applications that process data in defined chunks rather than as a continuous stream. This option is particularly valuable for MUD clients that need to handle structured or transactional data exchanges.

Details:

  1. Option Code: 25

  2. Functionality:

    • The EOR option allows the client and server to denote the end of each data record using an EOR marker.
    • The client should initiate EOR by sending IAC DO EOR to the server.
    • When EOR is active, each "record" sent by the server ends with the IAC EOR marker, allowing the client to recognize and process complete data units.
  3. Expected Workflow:

    • The client sends IAC DO EOR to request EOR support.
    • Upon receiving IAC WILL EOR from the server, the client and server begin using the EOR marker to signify record boundaries.
    • The client waits for IAC EOR at the end of each record and processes the data accordingly upon receipt.
  4. Acceptance Criteria:

    • The client successfully negotiates EOR with the server.
    • The client correctly identifies and handles data records ending with IAC EOR.
    • Data processing is organized in a record-based manner, ensuring that complete records are received and processed as individual units.

References:

mystiker commented 2 weeks ago

We will not support the EOR (End of Record) option because our client is designed to handle a continuous data stream rather than segmented records. However, EOR could be beneficial as it may help to logically separate output segments, which might improve data readability and processing. This feature could be valuable in the future if we find that distinguishing between output chunks would enhance the client’s performance or usability.

Furthermore, this option requires reading the data stream for IAC commands, like TIMING MARK does. If we ever implement this, we can implement TIMING MARK as well. See https://github.com/unitopia-de/webmud3/issues/129

mystiker commented 1 day ago

After reconsidering, I have changed my opinion on implementing the EOR (End of Record) option. I now believe EOR provides significant value to the client by allowing structured segmentation of the data stream, which can improve data readability and processing efficiency.

As a result, I have implemented EOR support in the linked PR. The implementation adheres to the expected workflow, ensuring proper negotiation and processing of data records marked with the EOR command.

Additionally, during implementation, I found that the manipulation of the data stream is less intrusive than I initially thought. The changes are minimal and do not interfere with the overall handling of the Telnet data stream. This makes EOR a lightweight yet impactful feature for our client.