interface ReadWriteSocket : ASocket, AReadable, AWritable
Represents both readable and writable socket
abstract val socketContext: Job
Represents a socket lifetime, completes at socket closure |
abstract fun attachForReading(channel: ByteChannel): WriterJob
Attach channel for reading so incoming bytes appears in the attached channel. Only one channel could be attached |
|
abstract fun attachForWriting(channel: ByteChannel): ReaderJob
Attach channel for writing so bytes written to the attached channel will be transmitted Only one channel could be attached |
|
open fun dispose(): Unit |
val ASocket.isClosed: Boolean
Check if the socket is closed |
suspend fun ASocket.awaitClosed(): Unit
Await until socket close |
|
fun AReadable.openReadChannel(): ByteReadChannel
Open a read channel, could be done only once |
|
fun AWritable.openWriteChannel(autoFlush: Boolean = false): ByteWriteChannel
Open a write channel, could be opened only once |
interface ConnectedDatagramSocket : ASocket, ABoundSocket, AConnectedSocket, ReadWriteSocket, DatagramReadWriteChannel
Represents a connected datagram socket. |
|
interface Socket : ReadWriteSocket, ABoundSocket, AConnectedSocket
Represents a connected socket |