//[ConnectBot Telnet Library](../index.md)/[org.connectbot.telnetlib](index.md)

# Package-level declarations

## Types

| Name | Summary |
|---|---|
| [NewlinePolicy](-newline-policy/index.md) | [jvm]<br>enum [NewlinePolicy](-newline-policy/index.md) : [Enum](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-enum/index.html)&lt;[NewlinePolicy](-newline-policy/index.md)&gt; |
| [NonBinaryPolicy](-non-binary-policy/index.md) | [jvm]<br>enum [NonBinaryPolicy](-non-binary-policy/index.md) : [Enum](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-enum/index.html)&lt;[NonBinaryPolicy](-non-binary-policy/index.md)&gt; |
| [TelnetCommand](-telnet-command/index.md) | [jvm]<br>enum [TelnetCommand](-telnet-command/index.md) : [Enum](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-enum/index.html)&lt;[TelnetCommand](-telnet-command/index.md)&gt; <br>In-band commands. TCP urgent-data SYNCH is deliberately not represented. |
| [TelnetConfig](-telnet-config/index.md) | [jvm]<br>class [TelnetConfig](-telnet-config/index.md)(terminalTypes: [List](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html)&lt;[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)&gt; = listOf(&quot;UNKNOWN&quot;), val columns: [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) = 0, val rows: [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) = 0, val profile: [TelnetProfile](-telnet-profile/index.md) = TelnetProfile.PASSIVE, val nonBinaryPolicy: [NonBinaryPolicy](-non-binary-policy/index.md) = NonBinaryPolicy.STRICT_ASCII, val newlinePolicy: [NewlinePolicy](-newline-policy/index.md) = NewlinePolicy.PRESERVE_LF, val consumeRecords: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) = false, val charset: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? = null, val maxSubnegotiationBytes: [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) = 64 * 1024, val inputBudgetBytes: [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) = 256 * 1024, val outputBudgetBytes: [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) = 256 * 1024, val maxPendingEvents: [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) = 8192, val controlBudgetBytes: [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) = 32 * 1024, val charsetTimeoutMillis: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html), val closeTimeoutMillis: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html))<br>Immutable protocol settings. Terminal capabilities must match the actual emulator. |
| [TelnetDirection](-telnet-direction/index.md) | [jvm]<br>enum [TelnetDirection](-telnet-direction/index.md) : [Enum](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-enum/index.html)&lt;[TelnetDirection](-telnet-direction/index.md)&gt; <br>Negotiation direction: LOCAL is WILL/WONT; REMOTE is DO/DONT. |
| [TelnetEffect](-telnet-effect/index.md) | [jvm]<br>sealed interface [TelnetEffect](-telnet-effect/index.md)<br>An ordered effect. Outbound arrays are complete frames owned by their recipient. |
| [TelnetEngine](-telnet-engine/index.md) | [jvm]<br>class [TelnetEngine](-telnet-engine/index.md)<br>Deterministic, single-owner client engine. No sockets, callbacks, or coroutine state. Feed at most [CHUNK_SIZE](-telnet-engine/-companion/-c-h-u-n-k_-s-i-z-e.md) 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](-telnet-engine/start.md) once before other operations and [finish](-telnet-engine/finish.md) once at peer EOF. Invalid slices, dimensions and oversized writes throw IllegalArgumentException. Starting twice or using an unstarted engine throws IllegalStateException. |
| [TelnetFailure](-telnet-failure/index.md) | [jvm]<br>data class [TelnetFailure](-telnet-failure/index.md)(val code: [TelnetFailureCode](-telnet-failure-code/index.md), val message: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html))<br>An operational failure returned as data; argument and state preconditions still throw. |
| [TelnetFailureCode](-telnet-failure-code/index.md) | [jvm]<br>enum [TelnetFailureCode](-telnet-failure-code/index.md) : [Enum](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-enum/index.html)&lt;[TelnetFailureCode](-telnet-failure-code/index.md)&gt; <br>Stable failure categories returned at public API boundaries. |
| [TelnetInput](-telnet-input/index.md) | [jvm]<br>sealed interface [TelnetInput](-telnet-input/index.md)<br>Lossless, ordered application input; each Data owns its array. |
| [TelnetOption](-telnet-option/index.md) | [jvm]<br>enum [TelnetOption](-telnet-option/index.md) : [Enum](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-enum/index.html)&lt;[TelnetOption](-telnet-option/index.md)&gt; <br>Options supported by the Telnet client. |
| [TelnetOutcome](-telnet-outcome/index.md) | [jvm]<br>sealed interface [TelnetOutcome](-telnet-outcome/index.md)&lt;out [T](-telnet-outcome/index.md)&gt; |
| [TelnetProfile](-telnet-profile/index.md) | [jvm]<br>enum [TelnetProfile](-telnet-profile/index.md) : [Enum](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-enum/index.html)&lt;[TelnetProfile](-telnet-profile/index.md)&gt; |
| [TelnetResult](-telnet-result/index.md) | [jvm]<br>data class [TelnetResult](-telnet-result/index.md)(val consumed: [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html), val effects: [List](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html)&lt;[TelnetEffect](-telnet-effect/index.md)&gt;, val failure: [TelnetFailure](-telnet-failure/index.md)? = null)<br>A bounded processing step, including complete effects preceding any failure. |
| [TelnetSession](-telnet-session/index.md) | [jvm]<br>interface [TelnetSession](-telnet-session/index.md)<br>Ordered, single-consumer input and concurrent suspend output operations. |
| [TelnetSnapshot](-telnet-snapshot/index.md) | [jvm]<br>data class [TelnetSnapshot](-telnet-snapshot/index.md)(val status: [TelnetStatus](-telnet-status/index.md) = TelnetStatus.OPEN, val localEcho: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) = true, val incomingBinary: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) = false, val outgoingBinary: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) = false, val charset: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? = null, val charsetPending: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) = false, val failure: [TelnetFailure](-telnet-failure/index.md)? = null) |
| [TelnetStatus](-telnet-status/index.md) | [jvm]<br>enum [TelnetStatus](-telnet-status/index.md) : [Enum](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-enum/index.html)&lt;[TelnetStatus](-telnet-status/index.md)&gt; |
| [TelnetTransport](-telnet-transport/index.md) | [jvm]<br>interface [TelnetTransport](-telnet-transport/index.md)<br>A duplex byte transport. Positive reads make progress; -1 is EOF, zero is only legal for a zero-length request. Write must finish the entire slice. Close must promptly interrupt a suspended read/write and be safe to call repeatedly. |

## Functions

| Name | Summary |
|---|---|
| [createTelnetEngine](create-telnet-engine.md) | [jvm]<br>fun [createTelnetEngine](create-telnet-engine.md)(config: [TelnetConfig](-telnet-config/index.md) = TelnetConfig()): [TelnetEngine](-telnet-engine/index.md)<br>Creates a fresh engine after validating configuration. Start it before feeding bytes. |
| [openTelnetSession](open-telnet-session.md) | [jvm]<br>fun [openTelnetSession](open-telnet-session.md)(scope: CoroutineScope, transport: [TelnetTransport](-telnet-transport/index.md), config: [TelnetConfig](-telnet-config/index.md) = TelnetConfig(), workerContext: [CoroutineContext](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.coroutines/-coroutine-context/index.html) = scope.coroutineContext.minusKey(Job)): [TelnetSession](-telnet-session/index.md)<br>Opens a child session over an already connected transport. The session owns and closes that transport. Each large write is accepted in independent bounded chunks, allowing negotiation and competing operations between chunks. |
