Package-level declarations

Types

Link copied to clipboard
interface ABoundSocket

Represents a bound socket

Link copied to clipboard
interface Acceptable<out S : ASocket> : ASocket

Represents a socket source, for example server socket

Link copied to clipboard

Represent a connected socket

Link copied to clipboard
interface AReadable

Represent a readable socket

Link copied to clipboard
interface ASocket : Closeable, DisposableHandle

Base type for all async sockets

Link copied to clipboard
interface AWritable

Represents a writable socket

Link copied to clipboard

Represents a bound datagram socket

Link copied to clipboard

Represent a configurable socket

Link copied to clipboard
Link copied to clipboard
class Connection(val socket: Socket, val input: ByteReadChannel, val output: ByteWriteChannel)

Represents a connected socket with its input and output

Link copied to clipboard
class Datagram(val packet: ByteReadPacket, val address: SocketAddress)

UDP datagram with packet content targeted to address

Link copied to clipboard

A channel for receiving datagrams

Link copied to clipboard

A channel for sending and receiving datagrams

Link copied to clipboard

A channel for sending datagrams

Link copied to clipboard
expect class InetSocketAddress(hostname: String, port: Int) : SocketAddress
actual class InetSocketAddress(hostname: String, port: Int) : SocketAddress
actual class InetSocketAddress(val hostname: String, val port: Int) : SocketAddress
Link copied to clipboard

Represents both readable and writable socket

Link copied to clipboard

Represents a server bound socket ready for accepting connections

Link copied to clipboard
interface Socket : ReadWriteSocket, ABoundSocket, AConnectedSocket, CoroutineScope

Represents a connected socket

Link copied to clipboard
expect sealed class SocketAddress
actual sealed class SocketAddress
actual sealed class SocketAddress
Link copied to clipboard
Link copied to clipboard
sealed class SocketOptions

Socket options builder

Link copied to clipboard
Link copied to clipboard

TCP socket builder

Link copied to clipboard
value class TypeOfService(val value: UByte)

An inline class to hold a IP ToS value

Link copied to clipboard
Link copied to clipboard
expect class UnixSocketAddress(path: String) : SocketAddress
actual class UnixSocketAddress(path: String) : SocketAddress
actual class UnixSocketAddress(val path: String) : SocketAddress

Properties

Link copied to clipboard

Check if the socket is closed

Functions

Link copied to clipboard

Start building a socket

Link copied to clipboard
suspend fun ASocket.awaitClosed()

Await until socket close

Link copied to clipboard
suspend fun TcpSocketBuilder.connect(remoteAddress: SocketAddress, configure: SocketOptions.TCPClientSocketOptions.() -> Unit = {}): Socket
Link copied to clipboard

Opens socket input and output channels and returns connection object

Link copied to clipboard

Open a read channel, could be done only once

Link copied to clipboard

Open a write channel, could be opened only once

Link copied to clipboard
fun <T : Configurable<T, *>> T.tcpNoDelay(): T

Set TCP_NODELAY socket option to disable the Nagle algorithm.

Link copied to clipboard