[英]What is the most efficient Java implementation for a real time game server?
I'm planning on building a Java server that will handle real time game communications between clients. 我正计划构建一个Java服务器来处理客户端之间的实时游戏通信。 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)? 什么是最好的Java实现类型,可以有效地,并且希望在客户端和服务器之间高速准确地进行通信(比如每秒5-15个数据包)? 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. 我知道有很多类型的Java网络API(即ObjectInputStream和ObjectOutputStream,DatagramPacket,KyroNet等),但我不确定这种情况下最有效和/或最常用的实现是什么。 I would assume that most real time games use UDP communication methods, but I understand the reliability issues that come with it. 我认为大多数实时游戏都使用UDP通信方法,但我理解随之而来的可靠性问题。 Are there UDP implementations that have some form of flow control? 是否有UDP实现具有某种形式的流量控制? Anyway, thanks in advance! 无论如何,提前谢谢!
A few things to consider: 需要考虑的一些事项:
Given this, I'd recommend one of the following 鉴于此,我建议采用以下方法之一
Good luck! 祝好运!
Immidiately forget ObjectOutputStream and ObjectInputStream. 立即忘记了ObjectOutputStream和ObjectInputStream。 These are the standard output-input mechanisms of the old standard java serialization, which is slow and produces bloat objects. 这些是旧标准java序列化的标准输出输入机制,它很慢并且会产生膨胀对象。 Some resources to start with: 一些资源开始:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.