-
This is a newcomer's question for the usage of Netty. AFAIK, Netty is built upon Sockets and thus can be used for network IO. While sockets and regular files are both represented as FD from the OS perspective, I wonder if Netty can perform read or write over files. Epoll / IOCP / io_uring can be used in both network IO and file IO. In another words, compare the Netty's architecture and Asio's, I'm curious about the reason for the differences esp. for sockets vs. generic FDs: Anyway, it seems Netty is an attempt to improve JDK's sockets IO but I don't find widely-used libraries that tries to improve JDK's files IO. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Netty's programming model is centered around streaming data or messages in and out, which mirrors the stream and datagram sockets APIs. |
Beta Was this translation helpful? Give feedback.
Netty's programming model is centered around streaming data or messages in and out, which mirrors the stream and datagram sockets APIs.
Files, on the other hand, are seekable, extendable byte arrays. This favors a different programming model, and it's awkward to fit such APIs into the Netty pipeline/handler model.