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

CoroutineNetworkChannel

interface CoroutineNetworkChannel : NetworkChannel (source)

A co-routine based network channel.

Properties

localPort

The port number on the local host to which this socket is bound.

abstract val localPort: Int

Functions

bind

Binds the channel's socket to a local address.

abstract fun bind(local: SocketAddress?): CoroutineNetworkChannel

close

Closes this channel.

abstract fun close(): Unit

getAdvertisableAddress

Returns the InetAddress corresponding to the interface this channel's socket is bound to.

open fun getAdvertisableAddress(): InetAddress?

getLocalAddress

Returns the socket address that this channel's socket is bound to.

abstract fun getLocalAddress(): SocketAddress?

getOption

Returns the value of a socket option.

abstract fun <T : Any> getOption(name: SocketOption<T>): T?

isOpen

Indicates if this channel is open.

abstract fun isOpen(): Boolean

setOption

Sets the value of a socket option.

abstract fun <T : Any> setOption(name: SocketOption<T>, value: T?): NetworkChannel

supportedOptions

Returns a set of the socket options supported by this channel.

abstract fun supportedOptions(): Set<SocketOption<*>>

Inheritors

CoroutineDatagramChannel

A co-routine based datagram-oriented network channel.

class CoroutineDatagramChannel : CoroutineByteChannel, ScatteringCoroutineByteChannel, GatheringCoroutineByteChannel, CoroutineNetworkChannel

CoroutineServerSocketChannel

A co-routine based network channel for stream-oriented connection listening.

class CoroutineServerSocketChannel : CoroutineNetworkChannel

CoroutineSocketChannel

A co-routine based stream-oriented network channel.

class CoroutineSocketChannel : CoroutineByteChannel, ScatteringCoroutineByteChannel, GatheringCoroutineByteChannel, CoroutineNetworkChannel