无法接收 UDP 数据报
我必须开发一个分布式系统,其中包括通过 TCP 套接字与来自其 IP 地址的某人进行聊天会话,该系统连接到一个服务器,该服务器列出了过去 3 分钟连接到它的所有 ip。除了这个主要功能之外,应用程序还必须向每个 IP 发出请求,以获取其名称和当前状态(活动、忙碌或停止)。通过 UDP 套接字发送该请求后,在另一端,它们也必须通过 UDP 发送该请求的回复。
编辑 - 基本上,应用程序必须联系存储最后几分钟连接到服务器的 ip 的服务器。然后它必须检索该 IP 地址并联系每个地址以获取其名称和状态。
不幸的是,我只收到了对我的请求的答复,但其他同事收到了我的请求。
我该如何解决这种情况?
i have to develop a distributed system that consists in having a chat session by TCP sockets with someone from it's IP address, connected to a server that lists all ips connected for the last 3 minutes to it. alongside with this main feature the app must make requests to every ip to get their name and current state, active, busy or stopped. after sending that request over UDP sockets and, in the other side they must send a reply of that request also over UDP.
EDIT - basically, the application must contact a server that stores the ips that connected to the server for the last minutes. then it must retrieve that ip addresses and contact each one to get it's name and status.
unfortunately i only receive my reply to my request but the other colleagues receive my request.
how can i fix this situation?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您没有向我们提供太多信息,但我的第一个想法是防火墙或路由问题。网络拓扑结构是怎样的?服务器和正常工作的客户端是否位于防火墙或 NAT 路由器的同一侧,而其他不工作的客户端位于另一侧?来自非工作客户端的 UDP 回复是否会传输到网络上?它们是否已到达您的服务器,但服务器软件未正确接收? (最后几个问题可以通过使用 Wireshark 等工具来查看离开客户端和到达的网络流量来回答在服务器上。)
You haven't given us much information to go on, but my first thought would be firewall or routing issues. What's the network topology? Are the server and the properly working client on the same side of a firewall or NAT router, with the other non-working clients on the other side? Are the UDP replies from the non-working clients making it onto the wire? Are they arriving at your server, but not being received properly by the server software? (The last few questions could be answered by using a tool like Wireshark to see the network traffic leaving the clients and arriving at the server.)