All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.fireflysource.net.tcp.AsyncTcpConnectionExtension.kt Maven / Gradle / Ivy

There is a newer version: 5.0.2
Show newest version
package com.fireflysource.net.tcp

import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.launch

fun TcpServer.onAcceptAsync(block: suspend CoroutineScope.(connection: TcpConnection) -> Unit): TcpServer {
    this.onAccept { connection -> connection.coroutineScope.launch { block.invoke(this, connection) } }
    return this
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy