1
0
Fork 0
mirror of https://gitlab.com/futo-org/fcast.git synced 2025-06-24 21:25:23 +00:00

Added ensure not main thread.

This commit is contained in:
Koen 2024-01-08 10:26:09 +01:00
parent b13d0f7e81
commit 47ea3a3c42

View file

@ -66,6 +66,8 @@ class FCastSession(outputStream: OutputStream, private val _remoteSocketAddress:
val id = UUID.randomUUID() val id = UUID.randomUUID()
fun send(opcode: Opcode, message: String? = null) { fun send(opcode: Opcode, message: String? = null) {
ensureNotMainThread()
synchronized(_outputStreamLock) { synchronized(_outputStreamLock) {
try { try {
val data: ByteArray = message?.encodeToByteArray() ?: ByteArray(0) val data: ByteArray = message?.encodeToByteArray() ?: ByteArray(0)