replace runCatching exception swallow
This commit is contained in:
parent
8c37a0cef9
commit
e270b05d58
1 changed files with 3 additions and 1 deletions
|
|
@ -4,6 +4,7 @@ import java.net.Socket
|
|||
import kotlin.random.Random
|
||||
import kotlin.random.nextUInt
|
||||
import kotlinx.coroutines.CoroutineScope
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.SupervisorJob
|
||||
import kotlinx.coroutines.cancel
|
||||
import kotlinx.coroutines.flow.asFlow
|
||||
|
|
@ -11,6 +12,7 @@ import kotlinx.coroutines.flow.launchIn
|
|||
import kotlinx.coroutines.flow.onEach
|
||||
import kotlinx.coroutines.runBlocking
|
||||
import kotlinx.coroutines.supervisorScope
|
||||
import kotlinx.coroutines.withContext
|
||||
|
||||
class KtRconClient(
|
||||
private val host: String,
|
||||
|
|
@ -88,7 +90,7 @@ class KtRconClient(
|
|||
// put(p.terminator)
|
||||
// }
|
||||
|
||||
runCatching {
|
||||
withContext(Dispatchers.IO) {
|
||||
socket.getOutputStream().use { os ->
|
||||
os.write(bb.array())
|
||||
os.flush()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue