Add network socket example for ktor-network and netty
This commit is contained in:
18 files changed
+271
-60
No files matched your search
@@ -7,8 +7,14 @@
|
||||
|
||||
package cn.rtast.libmc.network
|
||||
|
||||
import cn.rtast.libmc.crypto.ProtocolContextBuilder
|
||||
|
||||
public abstract class SocketContext {
|
||||
public abstract val engine: SocketEngine
|
||||
|
||||
public fun createSocket(host: String, port: Int): RawSocket = engine.create(host, port)
|
||||
}
|
||||
}
|
||||
|
||||
public fun (ProtocolContextBuilder.() -> Unit).withCustom(
|
||||
block: ProtocolContextBuilder.() -> Unit,
|
||||
): ProtocolContextBuilder.() -> Unit = { this@withCustom.invoke(this); this.block() }
|
||||
Reference in New Issue
Block a user