TelnetFraming
Transport-agnostic Telnet framing layer. Separates IAC command sequences from the VT data stream and handles option negotiation (BINARY, SGA, ECHO, NAWS, TERMINAL-TYPE). Works over any IDuplexPipe (TCP, WebSocket, named pipe, etc.).
- Kind:
Class - Namespace: Repl.Telnet
- Assembly:
Repl.Telnet - Source: src/Repl.Telnet/TelnetFraming.cs
Signature
Section titled “Signature”public sealed class TelnetFraming : IAsyncDisposableInheritance
Section titled “Inheritance”Implements
Section titled “Implements”Constructors
Section titled “Constructors”TelnetFraming(IDuplexPipe)
Section titled “TelnetFraming(IDuplexPipe)”Creates a new Telnet framing layer over a bidirectional pipe.
public TelnetFraming(IDuplexPipe pipe)Parameters
Section titled “Parameters”pipe(IDuplexPipe)
Methods
Section titled “Methods”DisposeAsync()
Section titled “DisposeAsync()”Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources asynchronously.
public ValueTask DisposeAsync()Returns
Section titled “Returns”ValueTask - A task that represents the asynchronous dispose operation.
RunAsync(CancellationToken)
Section titled “RunAsync(CancellationToken)”Sends the initial Telnet negotiation and runs the receive/send loops until the transport closes or cancellation is requested.
public Task RunAsync(CancellationToken ct)Parameters
Section titled “Parameters”ct(CancellationToken)
Returns
Section titled “Returns”Properties
Section titled “Properties”VT data reader (IAC stripped) — connect to StreamedReplHost.
public ChannelTextReader Input { get; }Returns
Section titled “Returns”Output
Section titled “Output”VT data writer (auto-escapes 0xFF) — connect to StreamedReplHost.
public TextWriter Output { get; }Returns
Section titled “Returns”TerminalType
Section titled “TerminalType”Terminal type reported by the client, if any.
public string? TerminalType { get; }Returns
Section titled “Returns”Events
Section titled “Events”TerminalTypeChanged
Section titled “TerminalTypeChanged”Raised when the client reports a terminal type through TERMINAL-TYPE negotiation.
public event EventHandler<TelnetFraming.TerminalTypeEventArgs>? TerminalTypeChangedReturns
Section titled “Returns”EventHandler<TelnetFraming.TerminalTypeEventArgs>
WindowSizeChanged
Section titled “WindowSizeChanged”Raised when the client sends a NAWS subnegotiation with a new window size.
public event EventHandler<WindowSizeEventArgs>? WindowSizeChangedReturns
Section titled “Returns”EventHandler<WindowSizeEventArgs>