TelnetEngine

Deterministic, single-owner client engine. No sockets, callbacks, or coroutine state. Feed at most CHUNK_SIZE bytes per step; repeat with the unconsumed suffix. A result consumes input or reports a terminal failure; empty input is a no-op. Call start once before other operations and finish once at peer EOF. Invalid slices, dimensions and oversized writes throw IllegalArgumentException. Starting twice or using an unstarted engine throws IllegalStateException.

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
Link copied to clipboard

Advances position by consumed bytes; never changes limit or retains the buffer.

fun feed(bytes: ByteArray, offset: Int = 0, length: Int = bytes.size - offset): TelnetResult
Link copied to clipboard

Completes valid data and diagnoses a truncated control without dispatching partial SB.

Link copied to clipboard
Link copied to clipboard
fun isEnabled(option: TelnetOption, direction: TelnetDirection): Boolean
Link copied to clipboard
Link copied to clipboard
fun resize(columns: Int, rows: Int): TelnetResult
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun write(bytes: ByteArray, offset: Int = 0, length: Int = bytes.size - offset): TelnetResult

Encodes one bounded application slice. A trailing raw CR is paired by the next write or flush.