UDP套接字问题 - 没有从服务器接收数据 [英] UDP socket problem - not receiving data form server

查看:109
本文介绍了UDP套接字问题 - 没有从服务器接收数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个UDP套接字,它在多播套接字上发出请求,并等待

作为响应。此客户端不是在侦听多播IP,而是在

本地IP上侦听。服务器(UNIX)响应发送方的IP。在服务器上使用调试文件

我看到服务器在我的

机器上接收来自我的应用程序的请求,我看到服务器发送到我机器的正确IP和端口,

但是ReceiveFrom永远不会返回任何数据。如果我在Windows机器上运行多播

服务器它工作正常,只需从UNIX机器上运行的多播服务器获取数据就会给我带来问题。我用
运行netmon并观察数据包流量。根据netmon,服务器的

响应到达我的机器,其中包含数据。为什么没有插座

读。这是一个阻止的ReceiveFrom调用。我能看到的唯一区别

是Windows组播服务器使用内部IP和端口绑定

,而UNIX服务器使用多播IP和端口进行绑定。当我在UNIX机器上运行
客户端应用程序时,它们都可以从

窗口和UNIX中获得良好的数据。调试的不同之处在于,来自UNIX服务器的数据报包具有作为源IP的多播IP,以及来自UNIX服务器的

服务器的本地IP Windows服务器。两台服务器的目的地是
是客户端的本地IP,无论是UNIX客户端,还是

windows客户端。


怎么了。我尝试绑定到Windows服务器上的多播IP,但

它不允许它。


任何帮助都会非常感激。我已经在这一周内把头发拉了一两个星期。


提前谢谢,

jim

I have a UDP socket that sends out a request on a multicast socket and waits
for a response. This client is not listening on a multicast IP but the
local IP. The server (UNIX) responds to the sender''s IP. Using debug files
on the server I see the server receive the request from my application on my
machine and I see the server send to the correct IP and port of my machine,
but the ReceiveFrom never returns with any data. If I have a multicast
server running on a windows machine it works fine, just getting data from
the multicast server running on the UNIX machine is giving me problems. I
ran netmon and watched the packet flow. According to netmon the server''s
response arrives at my machine with the data in it. Why doesn''t the socket
read. This is a blocking ReceiveFrom call. The only difference I can see
is that the Windows multicast server binds using the internal IP and port
while the UNIX server binds using the multicast IP and port. When I run
client apps on the UNIX machines they all receive their data fine from both
windows and UNIX. The difference in the debug is the datagram packet has
the multicast IP as the source IP when coming from a UNIX server and the
server''s local IP when coming from the windows server. The destinations
from both servers are the local IPs of the client, be it UNIX client, or
windows client.

What''s wrong. I tried binding to the multicast IP on the windows server but
it won''t allow it.

Any help would be GREATLY appreciated. I''ve been pulling my hair out for
over a week on this one.

Thanks in advance,
jim

推荐答案

嗨Jim,


我目前正在研究这个问题,我会回到你很快就会收到



祝你有愉快的一天。


问候,


Felix Wang

Microsoft在线合作伙伴支持

安全! - www.microsoft.com/security

此帖子按原样提供没有保证,也没有授予任何权利。

Hi Jim,

I am currently doing research on this issue and I will get back to you as
soon as possible.

Have a nice day.

Regards,

Felix Wang
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.


嗨Jim,


您是否尝试过发送UDP数据包从UNIX服务器到Windows

机器的内部IP(而不是

多播地址)作为源地址?是否ReceivedFrom为这个简单的测试工作?


问候,


Felix Wang

Microsoft在线合作伙伴支持

安全! - www.microsoft.com/security

此帖子按原样提供没有保证,也没有授予任何权利。

Hi Jim,

Have you tried sending a UDP packet with an internal IP (instead of a
multicast address) as source address from the UNIX server to the Windows
machine? Does "ReceivedFrom" work for that simple test?

Regards,

Felix Wang
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.


嗨Jim,


您是否尝试过发送UDP数据包从UNIX服务器到Windows

机器的内部IP(而不是

多播地址)作为源地址?换句话说,这是来自UNIX服务器的普通UDP数据包

到Windows框。是ReceiveFrom吗?为这个简单的测试工作?


问候,


Felix Wang

Microsoft在线合作伙伴支持

安全! - www.microsoft.com/security

此帖子按原样提供没有保证,也没有赋予任何权利。

Hi Jim,

Have you tried sending a UDP packet with an internal IP (instead of a
multicast address) as source address from the UNIX server to the Windows
machine? In other words, this is a plain UDP packet from your UNIX server
to Windows box. Does "ReceiveFrom" work for that simple test?

Regards,

Felix Wang
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.


这篇关于UDP套接字问题 - 没有从服务器接收数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆