Created
February 11, 2026 19:59
-
-
Save LethalMaus/f2542662874b39c9d3b6bd75a7ec28aa to your computer and use it in GitHub Desktop.
ZeroMq.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| private fun startReceiving() { | |
| receiveJob = CoroutineScope(Dispatchers.IO).launch { | |
| try { | |
| while (isRunning && subSocket != null) { | |
| val message = subSocket?.recvStr() | |
| if (message != null) { | |
| Log.d(TAG, "Server received message: $message") | |
| messageCallback?.invoke(message) | |
| } | |
| } | |
| } catch (e: Exception) { | |
| Log.e(TAG, "Error receiving message: ${e.message}", e) | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment