Hi everyone, I’m working on a multiplatform DNS library in pure Kotlin (targeting JVM, linuxX64, linuxArm64 and Android). I’ve been looking at ktor-network for the UDP and TCP side and overall it works well, but I’ve run into a few limitations that matter for a performance-sensitive use case.
On the UDP side it doesn’t seem possible to receive into a buffer that I fully control — every receive ends up going through the internal pool and producing a new Datagram/Source. I’d like to avoid per-packet allocations as much as possible. Connected UDP sockets and the basic socket options (buffer sizes, reuse address/port, etc.) are available and work, which is great, but the lack of a zero-copy or caller-owned buffer path is the main pain point.
I’m also interested in DNS over TLS. ktor-network-tls works on the JVM, but on Native it currently throws “TLS sessions are not supported on Native platform”. Is there any plan to support raw TLS sockets on the Native targets, or is the expectation that people should use platform TLS (OpenSSL, etc.) on top of a plain TCP socket?
I’m trying to decide whether ktor-network gives enough low-level control for this library or whether I should write a thin networking layer myself. Any guidance from people who have used these APIs on Native, or from the maintainers, would be really helpful. Thanks!