Skip to content

Instantly share code, notes, and snippets.

@LethalMaus
Created February 11, 2026 19:59
Show Gist options
  • Select an option

  • Save LethalMaus/f4ccb13e55be0932526e08d4b014a531 to your computer and use it in GitHub Desktop.

Select an option

Save LethalMaus/f4ccb13e55be0932526e08d4b014a531 to your computer and use it in GitHub Desktop.
ZeroMq.kt
fun sendMessage(message: String) {
if (!isRunning || pubSocket == null) {
Log.e(TAG, "Cannot send message, client not connected")
return
}
try {
pubSocket?.send(message)
Log.d(TAG, "Sent message to server: $message")
} catch (e: ZMQException) {
Log.e(TAG, "Error sending message or receiving response: ${e.message}", e)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment