Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Install

kotlin {
    sourceSets {
        commonMain.dependencies {
            implementation("io.github.adventures92:sockit:0.0.2")
        }
    }
}

That single line covers every target. The library publishes five Maven modules and Gradle module metadata routes each target to the right one — you never name a platform artifact yourself.

ModuleArtifactUsed by
sockit.jar + .modulewhat commonMain resolves
sockit-android.aarAndroid
sockit-iosarm64.klibiOS device
sockit-iossimulatorarm64.klibiOS simulator (Apple silicon)
sockit-jvm.jarJVM

Requirements

Kotlin2.4+
AndroidminSdk 24
iOSarm64, simulator arm64 (Apple silicon)
JVM11+
ServerEngine.IO v4 · Socket.IO v5 — the socket.io 4.x line

There is no iosX64 target, so Intel Mac simulators are not covered.

What comes with it

These arrive transitively; you do not declare them:

  • kotlinx-coroutines-coreFlow, StateFlow, suspend
  • ktor-client-core + ktor-client-websockets — transport
  • kotlinx-serialization-jsonJsonElement appears in the public API
  • kotlinx-io-coreByteString for binary payloads
  • a Ktor engine per platform — OkHttp on Android, Darwin on iOS, CIO on JVM

Only api is public

Everything you can import lives in dev.adven.sockit.api. Every other package is internal and not part of the compatibility contract — it can change in a patch release. The public surface is guarded by Binary Compatibility Validator on both the JVM ABI and the iOS klibs, so an accidental break fails the build rather than reaching you.