原谅我刚开始学习Java网络编程。我刚刚读了Netty in Action其中提到了一个 OIO
。
NIO is used in this example because it’s currently the most widely used transport, thanks to its scalability and thoroughgoing asynchrony. But a different transport implementation could be used as well. If you wished to use the OIO transport in your server, you’d specify OioServerSocketChannel and OioEventLoopGroup.
我以前就知道 Java IO 和 NIO。但 OIO 是什么?
我试图在谷歌中搜索它,但一无所获。谁能帮忙解释一下这是什么?
最佳答案
OIO 代表 Old IO 或 Blocking IO。在这个模型中,每个套接字或客户端连接都会产生一个新的专用线程来处理请求。因此,数量或线程 == Activity 的客户端/套接字数量。
使用 NIO 或 New IO,可以用更少的线程为更多的客户端提供服务。这里,数字或线程 < Activity 的客户端/套接字数。
关于java - OIO在Java中是什么意思?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35167637/