commit 14/10/2025

combine with coding steph
This commit is contained in:
2025-10-14 08:50:05 +07:00
parent a133f9a170
commit 5f57e1bf2e
3 changed files with 31 additions and 4 deletions

View File

@@ -111,13 +111,13 @@ class BarixConnection(val index: UInt, var channel: String, val ipaddress: Strin
try {
val chunk = ByteArray(if (bb.remaining() > maxUDPsize) maxUDPsize else bb.remaining())
bb.get(chunk)
println("Buffer remain: $bufferRemain, sending chunk size: ${chunk.size}")
//println("Buffer remain: $bufferRemain, sending chunk size: ${chunk.size}")
while(bufferRemain<chunk.size){
delay(10)
println("Waiting until buffer enough..")
//println("Waiting until buffer enough..")
}
udp.send(DatagramPacket(chunk, chunk.size, inet))
//delay(1)
delay(2)
} catch (e: Exception) {
cbFail.accept("SendData to $ipaddress:$port failed, message: ${e.message}")
return@launch