Tcp

object Tcp : ServerTcpExtensions, ClientTcpExtensions

Functions

Link copied to clipboard
open fun ServerSocket.acceptAsFlow(): Flow<Connection>
Link copied to clipboard
open suspend fun bind(hostname: String, port: Int, maxConnections: Int = 10, builder: SocketOptions.AcceptorOptions.() -> Unit = {}, dispatcher: CoroutineContext = EmptyCoroutineContext, handle: suspend Connection.() -> Unit)
Link copied to clipboard
open fun bindAsFlow(hostname: String, port: Int, maxConnections: Int = 10, builder: SocketOptions.AcceptorOptions.() -> Unit = {}, dispatcher: CoroutineContext = EmptyCoroutineContext): Flow<Pair<ServerSocket, Flow<Connection>>>
Link copied to clipboard
open suspend fun bindAsync(hostname: String, port: Int, maxConnections: Int = 10, builder: SocketOptions.AcceptorOptions.() -> Unit = {}, dispatcher: CoroutineContext = EmptyCoroutineContext, handle: suspend Connection.() -> Unit): ServerSocket
Link copied to clipboard
open suspend fun connect(hostname: String, port: Int, builder: SocketOptions.TCPClientSocketOptions.() -> Unit = {}, dispatcher: CoroutineContext = EmptyCoroutineContext, handle: suspend Connection.() -> Unit)
Link copied to clipboard
open fun connectAsFlow(hostname: String, port: Int, builder: SocketOptions.TCPClientSocketOptions.() -> Unit = {}, dispatcher: CoroutineContext = EmptyCoroutineContext): Flow<Byte>
Link copied to clipboard
open suspend fun connectAsync(hostname: String, port: Int, builder: SocketOptions.TCPClientSocketOptions.() -> Unit = {}, dispatcher: CoroutineContext = EmptyCoroutineContext, handle: suspend Connection.() -> Unit): Connection