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/Ocp1TLSDatagramConnectiontypealiases - New
SwiftOCASecureandSwiftOCASecureDevicetargets keep the TLS surface out of the baseline modules - AES70-2024's mandated
TLS_DHE_PSK_WITH_AES_128_CBC_SHAis 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 firedidFindon A-record changes)isLocalflag added toOcaControllerFlags, set for in-process, Mach port, and Unix-domain-socket controllers- Android: SQLite dependency is now excluded so SwiftOCADevice compiles on Android
asyncMapaccepts non-Sendableclosures via asendingparameter, so actor-isolated callers no longer need@Sendabletransforms
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
Monitormoved off the@OcaConnectionglobal actor to prevent heartbeat starvation- Subscription refresh is now cancellation-aware during reconnection, and bails out early if the connection is lost
refreshCachedObjectPropertiesbails out when the connection drops- Reconnection now only triggers when a device's first address actually changes
_NetServiceInfoequality compares by name/type/domain instead of pointer identity- Fixed
NetServiceBrowserRunLoop scheduling for ongoing browse events - Connection cleanup consolidated into a
_cleanupConnection()pattern across all backends
Other fixes
OcaGroupfalls back to individual member resolution when no group controller is present- Property deserialization falls through to the
JSONDecoderpath when a direct cast fails addSubscriptionsfailures 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,
NonEmbeddedBuildcompilation condition added