ASocket

interface ASocket : Closeable, DisposableHandle

Base type for all async sockets

Properties

socketContext

abstract val socketContext: Job

Represents a socket lifetime, completes at socket closure

Functions

dispose

open fun dispose(): Unit

Extension Properties

isClosed

val ASocket.isClosed: Boolean

Check if the socket is closed

Extension Functions

awaitClosed

suspend fun ASocket.awaitClosed(): Unit

Await until socket close

Inheritors

Acceptable

interface Acceptable<out S : ASocket> : ASocket

Represents a socket source, for example server socket

BoundDatagramSocket

interface BoundDatagramSocket : 
    ASocket,
    ABoundSocket,
    AReadable,
    DatagramReadWriteChannel

Represents a bound datagram socket

ConnectedDatagramSocket

interface ConnectedDatagramSocket : 
    ASocket,
    ABoundSocket,
    AConnectedSocket,
    ReadWriteSocket,
    DatagramReadWriteChannel

Represents a connected datagram socket.

ReadWriteSocket

interface ReadWriteSocket : ASocket, AReadable, AWritable

Represents both readable and writable socket

ServerSocket

interface ServerSocket : 
    ASocket,
    ABoundSocket,
    Acceptable<Socket>

Represents a server bound socket ready for accepting connections