Skip to content

0.8.0

Latest

Choose a tag to compare

@lhoward lhoward released this 11 Jun 00:41
· 6 commits to main since this release

SwiftOCA 0.8.0

Highlights

TLS / DTLS support for OCP.1 πŸ”

Secure connections are now supported across Apple and Linux platforms, with both PSK and certificate-based authentication:

  • Two backends: Network.framework on Apple, OpenSSL on Linux, fronted by the Ocp1TLSStreamConnection / Ocp1TLSDatagramConnection typealiases
  • New SwiftOCASecure and SwiftOCASecureDevice targets keep the TLS surface out of the baseline modules
  • AES70-2024's mandated TLS_DHE_PSK_WITH_AES_128_CBC_SHA is advertised first; modern AEAD suites take over when peers support them
  • Extensive new test coverage, including negative-path, hostile-traffic, and fail-closed tests

Windows port πŸͺŸ

SwiftOCA, SwiftOCASecure, SwiftOCADevice, and SwiftOCASecureDevice (plus the example executables) now build and pass the full test suite (154 tests) on x86_64-unknown-windows-msvc, using FlyingSocks as the socket transport:

  • TCP stream client connections and device endpoints, plus WebSocket server, are supported; UDP and Unix-domain sockets are unavailable on Windows
  • Parameter/patch datasets are stored uncompressed when zlib is unavailable (blobs are self-describing, so reads handle either form)

New features

  • OcaConnectionBroker.refreshBrowsing() β€” re-scans DNS-SD so a known device that reappeared at a different IP triggers reconnection (NetServiceBrowser doesn't fire didFind on A-record changes)
  • isLocal flag added to OcaControllerFlags, set for in-process, Mach port, and Unix-domain-socket controllers
  • Android: SQLite dependency is now excluded so SwiftOCADevice compiles on Android
  • asyncMap accepts non-Sendable closures via a sending parameter, so actor-isolated callers no longer need @Sendable transforms

Reliability & reconnection fixes

  • Bonjour goodbye is now reliably sent on endpoint shutdown β€” a retain cycle previously kept the registrar task alive, leaving stale advertisements until the cache TTL expired; all five backends now share one registrar helper
  • Monitor moved off the @OcaConnection global actor to prevent heartbeat starvation
  • Subscription refresh is now cancellation-aware during reconnection, and bails out early if the connection is lost
  • refreshCachedObjectProperties bails out when the connection drops
  • Reconnection now only triggers when a device's first address actually changes
  • _NetServiceInfo equality compares by name/type/domain instead of pointer identity
  • Fixed NetServiceBrowser RunLoop scheduling for ongoing browse events
  • Connection cleanup consolidated into a _cleanupConnection() pattern across all backends

Other fixes

  • OcaGroup falls back to individual member resolution when no group controller is present
  • Property deserialization falls through to the JSONDecoder path when a direct cast fails
  • addSubscriptions failures are now logged instead of silently swallowed
  • Connection ID included in the "connected" log message
  • Xcode project fixes: missing TLS source files registered, FlyingFox/FlyingSocks added to test target dependencies on Apple, NonEmbeddedBuild compilation condition added