commit 14/10/2025
combine with coding steph
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user