class TcpStream
source · line 10public class TcpStream internal constructor(
private val owner: SocketOwner
) : ByteSource, ByteSink, Closeable
- Supertype
ByteSource - Supertype
ByteSink - Supertype
Closeable - Inherited
fun dispose(): Unit· Closeable
An owned blocking TCP connection. Input and output can be half-closed separately; close releases the entire connection.
function readInto
source · line 56public override fun readInto(buffer: NativeByteBuffer, count: Long): Long
- Overrides
readInto· ByteSource
Reads into the selected writable region, returning actual bytes and permitting short reads. Zero for a positive request denotes EOF.
parameter count
source · line 56count: Long
parameter buffer
source · line 56buffer: NativeByteBuffer
function close
source · line 158public override fun close(): Unit
- Overrides
close
Closes the owned native descriptor; subsequent I/O through this owner is invalid.
function flush
source · line 152public override fun flush(): Unit
- Overrides
flush· ByteSink
Checks the unbuffered connection state; it does not wait for peer acknowledgement.
function shutdownInput
source · line 132public fun shutdownInput(): Unit
Shuts down the connection's input direction.
function writeFrom
source · line 79public override fun writeFrom(buffer: NativeByteBuffer, count: Long): Long
- Overrides
writeFrom· ByteSink
Consumes the selected readable region, returning the actual accepted byte count and permitting short writes.
parameter buffer
source · line 79buffer: NativeByteBuffer
parameter count
source · line 79count: Long
property isClosed
source · line 16public val isClosed: Boolean
get: public read-only
Whether this owned resource has been closed.
getter get
source · line 16get(): Boolean
function noDelay
source · line 28public fun noDelay(): Boolean
Queries the TCP_NODELAY setting.
function peerAddress
source · line 24public fun peerAddress(): SocketAddress
Queries the remote endpoint of this connection.
function shutdownOutput
source · line 138public fun shutdownOutput(): Unit
Shuts down output while preserving the input direction.
function setNoDelay
source · line 109public fun setNoDelay(value: Boolean): Unit
Enables or disables TCP_NODELAY.
parameter value
source · line 109value: Boolean
function setKeepAlive
source · line 115public fun setKeepAlive(value: Boolean): Unit
Enables or disables operating-system TCP keepalive.
parameter value
source · line 115value: Boolean
function localAddress
source · line 20public fun localAddress(): SocketAddress
Queries the local endpoint of this connection.
function keepAlive
source · line 32public fun keepAlive(): Boolean
Queries whether TCP keepalive is enabled.