feat(native): integrate all native platforms via MQTT 3.1.1 over ktor-network#427
Draft
feat(native): integrate all native platforms via MQTT 3.1.1 over ktor-network#427
Conversation
… implementation Co-authored-by: nicolasfara <11615611+nicolasfara@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Integrate all native platforms using async paho.mqtt
feat(native): integrate all native platforms via MQTT 3.1.1 over ktor-network
Mar 12, 2026
…ternatives Co-authored-by: nicolasfara <11615611+nicolasfara@users.noreply.github.com>
|
| GitGuardian id | GitGuardian status | Secret | Commit | Filename | |
|---|---|---|---|---|---|
| 29153006 | Triggered | Generic Password | fb7cb34 | src/nativeMain/kotlin/io/github/nicolasfara/NativeMqttProtocol.kt | View secret |
🛠 Guidelines to remediate hardcoded secrets
- Understand the implications of revoking this secret by investigating where it is used in your code.
- Replace and store your secret safely. Learn here the best practices.
- Revoke and rotate this secret.
- If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.
To avoid such incidents in the future consider
- following these best practices for managing and storing secrets including API keys and other credentials
- install secret detection on pre-commit to catch secret before it leaves your machine and ease remediation.
🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Native targets (Linux, macOS, iOS, Windows, watchOS, tvOS) were completely absent — commented out in the build with no
actualimplementation. This PR enables them using ktor-network 3.4.1 (pure Kotlin, no system deps) as the transport layer with a hand-rolled MQTT 3.1.1 implementation.Build changes
kotlin.native.ignoreDisabledTargets=trueso unsupported targets are silently skipped per hostapplyDefaultHierarchyTemplate()and register all native targets:linuxX64,linuxArm64,mingwX64,macosX64/Arm64,iosArm64,iosSimulatorArm64,watchosArm32/64/SimulatorArm64,tvosArm64/SimulatorArm64ktor-network+ktor-network-tls(3.4.1) tonativeMainsource setNative implementation (
NativeMkttClient)MkttClientinterface+/#topic-filter matching, and allMqttConnectionStatetransitionsMutex; all pending ACKDeferreds are cancelled on disconnectktor 3.x API compatibility
ByteReadChannel.readByte(),ByteWriteChannel.writeByte(), andwriteFully()were removed in ktor 3.x. Replaced with:readOneByte()helper using the still-availablereadFully(ByteArray, 0, 1)buildFullPacket()assembles the complete frame (fixed-header + variable-length remaining-length + payload) into aByteArrayviaMqttBuffer, then written in onewc.write(size) { buf -> buf.write(packet, 0, packet.size) }callWarning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
download.jetbrains.com/usr/lib/jvm/temurin-17-jdk-amd64/bin/java /usr/lib/jvm/temurin-17-jdk-amd64/bin/java --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED --add-opens=java.base/java.nio.charset=ALL-UNNAMED --add-opens=java.base/java.net=ALL-UNNAMED --add-opens=java.base/java.util.concurrent=ALL-UNNAMED --add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED --add-opens=java.xml/javax.xml.namespace=ALL-UNNAMED --add-opens=java.base/java.time=ALL-UNNAMED -XX:MaxMetaspaceSize=2g -Xmx2g -Dfile.encoding=UTF-8 -Duser.country -Duser.language=en(dns block)scans-in.gradle.com/usr/lib/jvm/temurin-17-jdk-amd64/bin/java /usr/lib/jvm/temurin-17-jdk-amd64/bin/java --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED --add-opens=java.base/java.nio.charset=ALL-UNNAMED --add-opens=java.base/java.net=ALL-UNNAMED --add-opens=java.base/java.util.concurrent=ALL-UNNAMED --add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED --add-opens=java.xml/javax.xml.namespace=ALL-UNNAMED --add-opens=java.base/java.time=ALL-UNNAMED -XX:MaxMetaspaceSize=2g -Xmx2g -Dfile.encoding=UTF-8 -Duser.country -Duser.language=en(dns block)If you need me to access, download, or install something from one of these locations, you can either:
📍 Connect Copilot coding agent with Jira, Azure Boards or Linear to delegate work to Copilot in one click without leaving your project management tool.