UDP 客户端仅接收第一个传输,而不会接收后续传输
我之前曾问过类似的问题,但由于缺乏我提供的代码而得到的帮助有限。我编写了一个客户端/服务器应用程序作为我的组织正在开发的游戏的原型。我遇到的问题是,客户端在建立初始连接后,发送 UDP 数据并接收第一个数据包,但不会接收其余数据包。客户端正在启动“连接”(我知道UDP是一种无连接协议......你知道我的意思)。我检查了通过wireshark发送和接收的数据包,它们的发送和接收显然是正确的。服务器是端口转发的,因此它接收来自客户端的所有数据。我没有收到任何错误,并且数据包的大小大致相同。我已经在这里发布了我的代码: http://pastebin.com/k5NsBDsQ 这样你就可以浏览它并看到可能出现错误的地方。这是完整的代码,而不仅仅是我认为相关的部分。预先感谢您的帮助。
I have asked a similar question to this before, but received limited help because of the lack of code I provided. I have written a client/server application as the prototype for a game my organization is developing. The issue I have is that the client after the initial connection is made, sends UDP data and receives the very first packet, but none of the rest. The client is initiating the "connection"(I know UDP is a connectionless protocol... you know what I mean). I have checked the packets sent and received through wireshark and they are being sent and received apparently correctly. The server is port forwarded so it receives all the data coming from the client. I am getting no errors, and the packets are all approximately the same size. I have posted my code here: http://pastebin.com/k5NsBDsQ so that you can look through it and see where a mistake might be. This is the complete code not just the parts I believe relevant. Thanks in advance for your help.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论