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

CoroutineSocketChannel

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

A co-routine based stream-oriented network channel.

Properties

isConnected

Indicates whether this channel is connected.

val isConnected: Boolean

remoteAddress

Get the remote address to which this channel is connected.

val remoteAddress: SocketAddress

Functions

bind

Binds the channel's socket to a local address.

fun bind(local: SocketAddress?): CoroutineSocketChannel

close

Closes this channel.

fun close(): Unit

connect

Connect this channel.

suspend fun connect(remote: SocketAddress): CoroutineSocketChannel

shutdownInput

Shutdown the connection for reading without closing the channel.

fun shutdownInput(): CoroutineSocketChannel

shutdownOutput

Shutdown the connection for writing without closing the channel.

fun shutdownOutput(): CoroutineSocketChannel

Companion Object Functions

open

Opens a socket channel.

fun open(group: CoroutineChannelGroup = CommonCoroutineGroup): CoroutineSocketChannel