@@ -30,6 +30,7 @@ import io.netty.incubator.channel.uring.IOUring
3030import io.netty.incubator.channel.uring.IOUringEventLoopGroup
3131import io.netty.incubator.channel.uring.IOUringServerSocketChannel
3232import kotlin.reflect.KClass
33+ import elide.runtime.Logging
3334import elide.runtime.intrinsics.server.http.netty.NettyTransport.Companion.resolve
3435
3536/* *
@@ -51,23 +52,28 @@ internal sealed interface NettyTransport<T : ServerSocketChannel> {
5152 try {
5253 scope.group(eventLoopGroup())
5354 scope.channel(socketChannel().java)
54- } catch (_: UnsatisfiedLinkError ) {
55+ } catch (err: UnsatisfiedLinkError ) {
56+ logging.warn { " Falling back to NIO; native transport could not load: '${err.message} '" }
5557 scope.group(NioEventLoopGroup ())
5658 scope.channel(NioServerSocketChannel ::class .java)
5759 }
5860 }
5961
6062 companion object {
63+ private val logging by lazy {
64+ Logging .of(NettyTransport ::class )
65+ }
66+
6167 /* * Resolve a [NettyTransport] implementation for the current platform. */
6268 internal fun resolve (): NettyTransport <* > = when {
6369 // prefer `io_uring` if available (Linux-only, modern kernels)
6470 IOUring .isAvailable() -> IOUringTransport
6571
6672 // next up, prefer `epoll` if available (Linux-only, nearly all kernels)
67- // Epoll.isAvailable() -> EpollTransport
73+ Epoll .isAvailable() -> EpollTransport
6874
6975 // next up, opt for `kqueue` on Unix-like systems
70- // KQueue.isAvailable() -> KQueueTransport
76+ KQueue .isAvailable() -> KQueueTransport
7177
7278 // otherwise, fallback to NIO
7379 else -> NioTransport
0 commit comments