telnet_cs 0.19.0

dotnet add package telnet_cs --version 0.19.0
                    
NuGet\Install-Package telnet_cs -Version 0.19.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="telnet_cs" Version="0.19.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="telnet_cs" Version="0.19.0" />
                    
Directory.Packages.props
<PackageReference Include="telnet_cs" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add telnet_cs --version 0.19.0
                    
#r "nuget: telnet_cs, 0.19.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package telnet_cs@0.19.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=telnet_cs&version=0.19.0
                    
Install as a Cake Addin
#tool nuget:?package=telnet_cs&version=0.19.0
                    
Install as a Cake Tool

telnet_cs

What this is: a C# telnet server/client library, async only.

Fair warning: this is 100% GMO, non-organic clanker generated code.

I'm reasonably sure this is beginning to be mostly correct now, but use with caution.

This started out as a plain telnet client/server lib, and then I had the clanker port over most of the applicable features from telnetlib3.

I left a lot of telnetlib3's stuff out of scope, because it does A LOT.

There are known divergences from telnetlib3 listed here: divergences

Thanks and respect to jquast and all the other contributors of telnetlib3.

Mostly AI generated text follows:

A Telnet client and server library for .NET 10 (C# 14), implemented directly from the protocol specifications: RFC 854 (base protocol, NVT, commands, Synch), RFC 855 (option negotiation framework), RFC 1143 (negotiation state machine), plus the option RFCs 856 (binary), 857 (echo), 858 (suppress go-ahead), 859 (status), 860 (timing mark), 727 (logout), 779 (send-location), 885 (end-of-record), 1073 (window size), 1079 (terminal speed), 1091 (terminal type), 1096 (X display), 1184 (linemode), 1372 (toggle-flow-control), 1408/1572 (environment), 2066 (charset), and 2217 (com-port, framing level). RCTE (726) is refused — obsolete.

  • Client: telnet_cs.Client.Client — connect, negotiate (RFC 1143 state machine), read/write, login, NAWS, terminal type/speed, environment, linemode, charset negotiation, status/timing-mark, echo, Synch. Construct with await Client.CreateAsync(...) (the only path since 0.19; see the client guide).
  • Server: telnet_cs.Server.TelnetServer + ServerSession — accept loop (with TLS ClientHello sniffing), server-role negotiation, authentication helper, per-client options (terminal type, speed, window size, environment, linemode, charset), dynamic Timeout, idle Timeout.\r\n notice, and game-driven echo via SetEchoAsync / WriteWithEchoAsync (atomic WILL/WONT + prompt fusion for masked password prompts).
  • Ported from telnetlib3:
    • Negotiation behaviors — NAWS clamped to the 0–65535 wire range; terminal speed in "<tx>,<rx>" order per RFC 1079 §4 (telnetlib3 uses the opposite order — see divergences D14), validated then normalized (trimmed, leading zeros stripped, two ASCII-digit parts required; rounding only at the consumption point); TTYPE collection with LOOPMAX overflow slot, empty skipping, and MTTS filtering; single-active TSPEED/CHARSET requests; subnegotiations split across reads reassemble before dispatch; outbound byte[] data gets RFC 854 IAC doubling.
    • Environment/charset — auto TERM/LANG/COLUMNS/LINES answers, MS-telnet USER exclusion, force-binary on encoding-suffixed LANG/CHARSET, 4-case charset selection with US-ASCII fallback and TTABLE verbs ignored, deferred opening negotiation (ECHO and NEW-ENVIRON held back until TTYPE answers, skipped for MUD clients), and password echo suppression at login.
    • MUD + MCCP — GMCP/MSDP/MSSP/MSP/MXP/ZMP/ATCP/Aardwolf codecs and per-protocol dispatch with stores (MsspData, ZmpData, …), MTTS bitvector parsing, and MCCP2/MCCP3 zlib compression in both directions once agreed (server offers only when explicitly enabled, client compresses MCCP3 after the peer accepts; refused over TLS, DONT on corrupt streams).
    • Retro codecs — ATASCII, PETSCII, Atari ST, Big5-BBS (decode tables match telnetlib3 cell-for-cell), with strict/replace/ignore encode fallbacks and split-sequence-safe incremental coders.
    • Client input helpers — Client.InputFilter (ATASCII/PETSCII keymaps, longest-first sequence translation with ESC-delay hold-back) and Client.LinemodeBuffer (client-side LINEMODE EDIT: EC/EL/EW editing, TRAPSIG to IAC commands, forwardmask flush, CR/LF line send).
    • Server REPL shell — Server.ServerShells.RunReplAsync (Ready. banner, tel:sh> prompt with per-prompt Go-Ahead, and quit/help/version/negotiation/stats/environ/slc commands).
    • Runtime extras — SendGaAsync (SGA-aware Go-Ahead), generic WaitForNegotiationAsync / WaitForOptionEnabledAsync waiters, Server.TelnetSessionContext (activity timestamps, rx/tx counters, typescript recorder, property bag), IdleTimeout (default 300 s), StatusInterval (default 20 s), clean peer close (TCP FIN and TLS close_notify end the session after queued bytes drain), and opt-in TlsAutoDetect peek.
  • Full suite green with warnings-as-errors (see dotnet test output for the current count). Requires the .NET 10 SDK and runtime; build with dotnet build telnet_cs.sln -c Release.
  • Usage guides: client, server.

Install

The package version is single-sourced from VersionPrefix in telnet_cs/telnet_cs.csproj; substitute the current value for <version>:

<PackageReference Include="telnet_cs" Version="<version>" />
dotnet add package telnet_cs

Local dev without the feed: dotnet pack telnet_cs/telnet_cs.csproj -c Release and reference the resulting .nupkg from a local file feed.

Testing

Run the full suite (builds first, so a separate build step is optional):

dotnet test telnet_cs.sln -c Release

For a focused run, filter by test name or class:

dotnet test telnet_cs.sln -c Release --filter "FullyQualifiedName~MccpTests"
dotnet test telnet_cs.sln -c Release --filter "FullyQualifiedName~RetroEncodingTests"

Check formatting:

dotnet format --verify-no-changes
Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net10.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.19.0 133 9/18/2026
0.18.0 82 9/18/2026
0.17.0 82 9/18/2026
0.16.0 88 9/17/2026
0.15.0 82 9/17/2026
0.14.0 82 9/17/2026
0.13.0 88 9/17/2026
0.12.0 87 9/16/2026
0.11.0 87 9/16/2026
0.10.0 83 9/16/2026
0.9.0 90 9/16/2026