简体   繁体   English

KryoNet-将数据包发送到Android客户端

[英]KryoNet - Sending packets to Android clients

I am developing an Android app which has to connect clients to my server for sending/receiving different sort of packets. 我正在开发一个Android应用程序,该应用程序必须将客户端连接到我的服务器以发送/接收不同种类的数据包。 To achieve that, I am using the KryoNet library. 为此,我正在使用KryoNet库。 My clients connect themself to the server and send their own packets successfully. 我的客户将他们自己连接到服务器,并成功发送自己的数据包。 But my problem is that the server seems to failed at responding to them. 但是我的问题是服务器似乎无法响应它们。 I have registered these packets in the same order on the server side and the client side and I use the connection parameter of the overrided reveived method from kryonet.Listener to respond (eg connection.sendUDP(...) ). 我已经注册在服务器端和客户端相同的顺序这些数据包我用的是connection的overrided的参数reveived方法从kryonet.Listener响应(如connection.sendUDP(...) I have an Android 5.0.2 , I use the 2.22.0-RC1 version of KryoNet both on the server side and the client side... With the option Log.set(Log.LEVEL_DEBUG) enabled, I can see that the server starts to write a packet ( DEBUG: [kryo] write: PacketMovement ) but I receive nothing. 我使用的是Android 5.0.2,我用KryoNet两者的2.22.0-RC1版本在服务器端和客户端...随着选项Log.set(Log.LEVEL_DEBUG)启用,我可以看到服务器开始写一个数据包( DEBUG:[kryo] write:PacketMovement ),但是我什么也没收到。

I would really appreciate any help on this issue. 我真的很感谢在这个问题上的任何帮助。

有相同问题的人的答案: https : //github.com/EsotericSoftware/kryonet/pull/111

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM