This commit is contained in:
2025-09-29 06:30:39 +08:00
parent 20c229bfb7
commit 5e692bac6c
7 files changed
+138 -66

No files matched your search

+15 -8
View File
@@ -1,16 +1,16 @@
/*
* Copyright © 2025 RTAkland
* Author: RTAkland
* Date: 9/29/25
*/
* Copyright © 2025 RTAkland
* Author: RTAkland
* Date: 9/29/25
*/
package test
import cn.rtast.nmdns.broadcast
import cn.rtast.nmdns.createService
import cn.rtast.nmdns.randomMacAddress
import cn.rtast.nmdns.registerService
import cn.rtast.nmdns.sleep1
import kotlinx.coroutines.delay
import kotlinx.coroutines.runBlocking
import kotlin.test.Test
@@ -18,14 +18,21 @@ class LinuxTest {
@Test
fun `test on linux`() {
runBlocking {
val service = createService(
val service = registerService(
serviceType = "_airplay._tcp.local.",
serviceName = "AP@RTAST",
hostname = "rtakland.local.",
ipAddress = "192.168.10.104",
port = 7001,
bindAddress = "192.168.10.104",
mdnsPort = 5356
mdnsPort = 5356,
txtRecords = listOf(
"deviceid=${randomMacAddress()}",
"model=AppleTV3,2C",
"features=0x5A7FFFF7,0x1E",
"srcvers=220.68",
"pk=f3769a660475d27b4f6040381d784645e13e21c53e6d2da6a8c3d757086fc336"
)
)
while (true) {
service.broadcast()