请推荐实现可靠 udp 的 java 库。它将用于游戏服务器与客户端和其他服务器进行通信。
附言:也许您可以建议可以更高效地处理此类任务(游戏服务器)的技术?但这必须在 Linux 上工作。
编辑:这是一款 Action 类游戏,因此需要尽快与服务器通信。
编辑 2: 我找到了 Enet这是用于FPS游戏的,但它是C++,如果我一秒钟调用它多次,会不会有开销?
最佳答案
这些是我所知道的实现可靠 UDP 之类的库/框架:
MR-UDP aims at providing reliable communication based on UDP from/to mobile nodes (MNs), with least possible overhead. It extends a Reliable UDP (R-UDP) protocol with mobility-tolerating features, such as the ability to handle intermit-tent connectivity, Firewall/NAT traversal and robustness to switching of IP addresses or network interfaces (e.g. Cellular to WiFi, and vice-versa).
UDT is a reliable UDP based application level data transport protocol for distributed data intensive applications over wide area high-speed networks. UDT uses UDP to transfer bulk data with its own reliability control and congestion control mechanisms. The new protocol can transfer data at a much higher speed than TCP does. UDT is also a highly configurable framework that can accommodate various congestion control algorithms.
Fast, reliable & non-intrusive message-oriented virtual network protocol for the JVM 1.6+.
It resides between the transport and the application layer.
Characteristics:
- 传输数据的可靠性
- 收到,未经验证的数据立即可用
- 包比UDP的包大,比TCP的包小
- 无流量控制
- 无拥塞控制
免责声明:我是 JNetRobust 的作者,它是新的并且仍处于 alpha 阶段。
关于Java可靠的UDP,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6531956/