class AsyncTlsStream
source · line 14public class AsyncTlsStream internal constructor(private val state: TlsConnection) : AsyncByteStream, AsyncCloseable
- Supertype
AsyncByteStream - Supertype
AsyncCloseable
A TLS stream integrated with the current event loop and structured cancellation. The stream owns its transport after adoption and exposes plaintext through AsyncByteStream.
close waits for local cleanup. Use shutdownGracefully to exchange TLS close notifications.
function shutdownGracefully
source · line 77public suspend fun shutdownGracefully(): Unit
Exchanges TLS close notifications and then closes the owned connection, suspending while protocol I/O is required.
function close
source · line 82public override suspend fun close(): Unit
- Overrides
close
Waits for local transport and engine cleanup without performing a TLS close handshake.
property connectionInfo
source · line 54public val connectionInfo: TlsConnectionInfo
get: public read-only
The negotiated TLS version and ALPN; access fails with IoClosedException once closing begins.
getter get
source · line 54get(): TlsConnectionInfo
function readInto
source · line 63public override suspend fun readInto(buffer: NativeByteBuffer, count: Long): Long
- Overrides
readInto
Suspends until plaintext can be read into the requested writable buffer region. The returned count records actual progress.
parameter buffer
source · line 63buffer: NativeByteBuffer
parameter count
source · line 63count: Long
function flush
source · line 72public override suspend fun flush(): Unit
- Overrides
flush
Suspends until pending ciphertext has been drained and the underlying stream flushed.
function writeFrom
source · line 68public override suspend fun writeFrom(buffer: NativeByteBuffer, count: Long): Long
- Overrides
writeFrom
Suspends while writing a prefix of readable plaintext and advances the buffer by actual progress. Repeat to send the entire input.
parameter count
source · line 68count: Long
parameter buffer
source · line 68buffer: NativeByteBuffer
property isClosed
source · line 49public val isClosed: Boolean
get: public read-only
Whether the connection has finished local cleanup.
getter get
source · line 49get(): Boolean