首页| JavaScript| HTML/CSS| Matlab| PHP| Python| Java| C/C++/VC++| C#| ASP| 其他|
购买积分 购买会员 激活码充值

您现在的位置是:虫虫源码 > Java > 简单的java NIO异步套接字

简单的java NIO异步套接字

  • 资源大小:43.14 kB
  • 上传时间:2021-06-29
  • 下载次数:0次
  • 浏览次数:0次
  • 资源积分:1积分
  • 标      签: 简单 异步 套接字 javaNIO

资 源 简 介

Naga is not a framework. Naga aims to be a very small NIO library that provides a handful of java classes to wrap the usual Socket and ServerSocket with asynchronous NIO counterparts (similar to NIO2 planned for Java 1.7). All of this is driven from a single thread, making it useful for both client (e.g. allowing I/O to be done in the AWT-thread without any need for threads) and server programming (1 thread for all connections instead of 2 threads/connection). Internally Naga is a straightforward NIO implementation without any threads or event-queues thrown in, it is "just the NIO-stuff", to let you build things on top of it. Naga contains the code needed to get NIO up and running without having to code partially read buffers and setting various selection key flags. Here is an example opening a server socket: NIOService service = new NIOService;NIOServerSocket
VIP VIP
0.178357s