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

CoroutineNetworkChannel

interface CoroutineNetworkChannel : NetworkChannel (source)

A co-routine based network channel.

Properties

localPort

abstract val localPort: Int

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

Functions

bind

abstract fun bind(local: SocketAddress?): CoroutineNetworkChannel

Binds the channel's socket to a local address.

close

abstract fun close(): Unit

Closes this channel.

getAdvertisableAddress

open fun getAdvertisableAddress(): InetAddress?

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

getLocalAddress

abstract fun getLocalAddress(): SocketAddress?

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

getOption

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

Returns the value of a socket option.

isOpen

abstract fun isOpen(): Boolean

Indicates if this channel is open.

setOption

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

Sets the value of a socket option.

supportedOptions

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

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

Inheritors

CoroutineDatagramChannel

class CoroutineDatagramChannel : CoroutineByteChannel, ScatteringCoroutineByteChannel, GatheringCoroutineByteChannel, CoroutineNetworkChannel

A co-routine based datagram-oriented network channel.

CoroutineServerSocketChannel

class CoroutineServerSocketChannel : CoroutineNetworkChannel

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

CoroutineSocketChannel

class CoroutineSocketChannel : CoroutineByteChannel, ScatteringCoroutineByteChannel, GatheringCoroutineByteChannel, CoroutineNetworkChannel

A co-routine based stream-oriented network channel.