Java的NIO通讯类库 KryoNet

码农软件 · 软件分类 · 高性能网络开发库 · 2019-09-02 09:58:13

软件介绍

KryoNet这个Java类包提供了一套简洁的API来实现高效的,基于TCP和UDP协议的客户端/服务器NIO网络通信。KryoNet可以运行于桌面应用程序和Android平台中。由于KryoNet非常高效,所以特别适用于开发游戏应用程序和进程间通信。

示例代码:

Server server = new Server();
server.start();
server.bind(54555, 54777);
server.addListener(new Listener() {
   public void received (Connection connection, Object object) {
      if (object instanceof SomeRequest) {
         SomeRequest request = (SomeRequest)object;
         System.out.println(request.text);

         SomeResponse response = new SomeResponse();
         response.text = "Thanks!";
         connection.sendTCP(response);
      }
   }
});

 

本文地址:https://codercto.com/soft/d/13700.html

Struts 2 in Action

Struts 2 in Action

Don Brown、Chad Davis、Scott Stanlick / Manning Publications / 2008.3 / $44.99

The original Struts project revolutionized Java web development and its rapid adoption resulted in the thousands of Struts-based applications deployed worldwide. Keeping pace with new ideas and trends......一起来看看 《Struts 2 in Action》 这本书的介绍吧!

XML 在线格式化
XML 在线格式化

在线 XML 格式化压缩工具

UNIX 时间戳转换
UNIX 时间戳转换

UNIX 时间戳转换

HSV CMYK 转换工具
HSV CMYK 转换工具

HSV CMYK互换工具