Repository navigation
Conversation
added 3 commits
October 29, 2026 13:01
A sans-IO telnet parser slices server text between IAC bytes with memchr into zero-copy Bytes, negotiates ECHO, EOR, GMCP, MSSP and MCCP2, and refuses every other option, NAWS included. Subnegotiation spans chunks, MCCP2 starts mid-chunk and ends cleanly, and MSSP surfaces only NAME. The net module wraps it in a tokio task with a non-blocking handle, sends Core.Hello and Core.Supports.Set when GMCP is agreed, and offers a login hook for plugins. mudling-bench-telnet measures throughput and the cost per 4 KB chunk; examples/connect prints a server's events.
A longer subnegotiation is dropped up to IAC SE, reported once as Event::SubnegotiationDropped, and parsing carries on, so a broken server can't grow memory without limit.
…answers - Reuse the read buffer, reserving only when under 4 KB remains. - Time the connect out (ConnectOptions::connect_timeout, 10 s default) and abort it on close or when every handle drops. - LoginHook::answer returns bytes in the server's encoding. - Ignore the wall-clock linear-time test; the bench measures it. - The telnet bench uses the core's GMCP framing and constants, and names its decompressed totals telnet_*. - Say why MCCP2 output blocks are 16 KB.
added 2 commits
October 29, 2026 19:52
…lize' into wiffletree/core-connection-layer-telnet-gmcp-mccp2
The telnet bench is a second binary, so cargo run -p mudling-bench needs to know which one to run.
This was referenced Oct 30, 2026
Contributor
Author
|
Landed on main through #15. |
MHohlios
deleted the
wiffletree/core-connection-layer-telnet-gmcp-mccp2
branch
November 1, 2026 17:24
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds MUDling's connection layer to
mudling-core, as two modules:telnet: a sans-IO telnet parser, so a replay can drive itnet: a tokio TCP layer around itLinear: VYT-190 (Phase 1: Core, VYT-186). Stacked on #1 (Phase 0).
What's in it
NAMEonly) and MCCP2memchrslices text between IAC sequences with no copying (PRD §5 Core: default plugins (prompt learning, HUD fields, chaining, pagers, game detection) #8). A GMCP message costs time linear in its length.IAC SB COMPRESS2 IAC SE, and plain parsing resumes at stream end. It uses flate2 with the pure-Rust zlib-rs backend, which is about 90× faster than the default miniz_oxide.SubnegotiationDroppedevent, and parsing carries on.connect()returns at once, and sending never blocks.Connected,Data(Bytes),PromptEnd(GA/EOR),Gmcp { package, data },GmcpEnabled,Echo(bool)(false means a password prompt),Mssp(name),SubnegotiationDropped,Disconnected(reason).Numbers (release, M3 Pro,
mudling-bench-telnet --check)GMCP costs 0.4 ns per byte, the same at 32 KB as at 1 MB.
Tests
cargo run -p mudling-core --example connect -- host:porthas not been run against a real server.Follow-ups (not in this PR)
Data, which belongs to session wiring.Failed.