实时游戏服务器最有效的 Java 实现是什么?
我正计划构建一个 Java 服务器来处理客户端之间的实时游戏通信。最好的 Java 实现类型是什么,它可以高效且有望在客户端和服务器之间高速(例如每秒 5-15 个数据包)准确地进行通信?我知道有许多类型的 Java 网络 API(即 ObjectInputStream 和 ObjectOutputStream、DatagramPacket、KyroNet 等),但我不确定对于这种情况最有效和/或最常用的实现是什么。我认为大多数实时游戏都使用 UDP 通信方法,但我了解随之而来的可靠性问题。是否存在具有某种形式的流量控制的 UDP 实现?无论如何,提前致谢!
I'm planning on building a Java server that will handle real time game communications between clients. What is the best type of Java implementation out there that could efficiently and, hopefully, accurately communicate between a client and server at high speeds (say 5-15 packets per second)? I know there are many types of Java networking APIs (ie. ObjectInputStream and ObjectOutputStream, DatagramPacket, KyroNet, etc.), but I'm not sure what is the most effective and/or commonly used implementation for such a scenario. I would assume that most real time games use UDP communication methods, but I understand the reliability issues that come with it. Are there UDP implementations that have some form of flow control? Anyway, thanks in advance!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
需要考虑以下几点:
鉴于此,我建议使用以下之一
祝你好运!
A few things to consider:
Given this, I'd recommend one of the following
Good luck!
立即忘记 ObjectOutputStream 和 ObjectInputStream。这些是旧标准 java 序列化的标准输出-输入机制,它很慢并且会产生膨胀的对象。一些入门资源:
Immidiately forget ObjectOutputStream and ObjectInputStream. These are the standard output-input mechanisms of the old standard java serialization, which is slow and produces bloat objects. Some resources to start with: