This commit is contained in:
lushunming 2025-07-18 14:32:12 +08:00
parent 9f89678c45
commit 48f25a825b
4 changed files with 7 additions and 5 deletions

View File

@ -26,14 +26,15 @@ import java.nio.ByteBuffer
import java.nio.charset.Charset
object KtorServer {
private var port = 12345
private val THREAD_NUM = Runtime.getRuntime().availableProcessors() * 2
private val infos = mutableMapOf<String, Array<Any>>()
var ser: io.ktor.server.engine.ApplicationEngine? = null
var port = 12345
//每个片1MB
private val partSize = 1024 * 1024 * 1
fun init() {
do {
try {
ser = embeddedServer(CIO, port) {
@ -65,11 +66,12 @@ object KtorServer {
ser?.stop()
}
} while (port < 13000)
SpiderDebug.log("ktorServer start on $port")
}
/** 启动服务器 */
fun start() {
SpiderDebug.log("ktorServer start on $port")
CoroutineScope(Dispatchers.IO).launch { init() }
}

Binary file not shown.

View File

@ -1 +1 @@
7610a4d16212252a8db5108551e7c9a7
46bad00e2ccaae7cab15eb89fdb0e832

View File

@ -1,5 +1,5 @@
{
"spider": "https://gh.llkk.cc/https://raw.githubusercontent.com/lushunming/AndroidCatVodSpider/multiThreadNew/jar/custom_spider.jar;md5;7610a4d16212252a8db5108551e7c9a7",
"spider": "https://gh.llkk.cc/https://raw.githubusercontent.com/lushunming/AndroidCatVodSpider/multiThreadNew/jar/custom_spider.jar;md5;46bad00e2ccaae7cab15eb89fdb0e832",
"lives": [
{
"name": "电视直播",