net-coroutines / org.apache.tuweni.net.coroutines / CoroutineSocketChannel

CoroutineSocketChannel

class CoroutineSocketChannel : CoroutineByteChannel, ScatteringCoroutineByteChannel, GatheringCoroutineByteChannel, CoroutineNetworkChannel (source)

A co-routine based stream-oriented network channel.

Author
Chris Leishman - https://cleishm.github.io/

Properties

isConnected

val isConnected: Boolean

Indicates whether this channel is connected.

remoteAddress

val remoteAddress: SocketAddress

Get the remote address to which this channel is connected.

Functions

bind

fun bind(local: SocketAddress?): CoroutineSocketChannel

Binds the channel's socket to a local address.

close

fun close(): Unit

Closes this channel.

connect

suspend fun connect(remote: SocketAddress): CoroutineSocketChannel

Connect this channel.

shutdownInput

fun shutdownInput(): CoroutineSocketChannel

Shutdown the connection for reading without closing the channel.

shutdownOutput

fun shutdownOutput(): CoroutineSocketChannel

Shutdown the connection for writing without closing the channel.

Companion Object Functions

open

fun open(group: CoroutineChannelGroup = CommonCoroutineGroup): CoroutineSocketChannel

Opens a socket channel.