介绍:
原来在2000pro,2000server上跑的好好的UDP广播程序,现在移植到XP和2003下跑。结果:
客户端接受不到广播数据了。需要解决!问题分析:
由于广播的是视频数据,所以广播数据量很大,原来在2000下跑得很正常。有人说是XP、2003中对UDP广播有限制,不知道是不是这样?如果是,如何设置?

解决方案 »

  1.   

    关注,以前好象是5000字节把?
    要不自己写一个基于UDP的协议?
    up.
      

  2.   

    有人也发现同样的问题,在XP下广播只能发送 1100bytes,而且也不报错误,郁闷,高手帮帮忙阿
      

  3.   

    可以用Sniffer来看一下数据是否与想象的一样,首先要能接收到,其次再看数据大小。
      

  4.   

    sock的发送缓冲区有没有加大?
    应该不会有这样的问题啊。
      

  5.   

    superdai(淨居天人):
    发送缓冲区加大?如何做啊?不太明白你的意思 cnjj(待业王子) :
    么有防火墙,小于1100bytes的数据可以发送 danfeng(丹枫) :
    考虑过使用多播,但是这个程序是N年前的人写的,那不等于让我重新写一次么?!工作量太大了 StormRainbow(风雨_彩虹) :
    小于1100bytes的数据接受没有问题。在MSDN下看以下东东,不晓得有没有关系:
    Res
    The sendto function is used to write outgoing data on a socket. For message-oriented sockets, care must be taken not to exceed the maximum packet size of the underlying subnets, which can be obtained by using getsockopt to retrieve the value of socket option SO_MAX_MSG_SIZE. If the data is too long to pass atomically through the underlying protocol, the error WSAEMSGSIZE is returned and no data is transmitted.The to parameter can be any valid address in the socket's address family, including a broadcast or any multicast address. To send to a broadcast address, an application must have used setsockopt with SO_BROADCAST enabled. Otherwise, sendto will fail with the error code WSAEACCES. For TCP/IP, an application can send to any multicast address (without becoming a group member).Note  If a socket is opened, a setsockopt call is made, and then a sendto call is made, Windows Sockets performs an implicit bind function call.If the socket is unbound, unique values are assigned to the local association by the system, and the socket is then ed as bound. An application can use getsockname to determine the local socket name in this case.The successful completion of a sendto does not indicate that the data was successfully delivered.The sendto function is normally used on a connectionless socket to send a datagram to a specific peer socket identified by the to parameter. Even if the connectionless socket has been previously connected to a specific address, the to parameter overrides the destination address for that particular datagram only. On a connection-oriented socket, the to and tolen parameters are ignored, making sendto equivalent to send.
      

  6.   

    据我所知,在局域网中,网关一般不允许广播,耗资源太大了。我们现在的这个项目,也是这个原因,后来只能采用UDP,一个一个的发。
      

  7.   

    cynew(chenyong):我的网络里没有网关啊,而且跑在Windows2000下就一切OK
      

  8.   

    我也遇到过这个问题,后来我改成组播就好了,MSDN上好像说过,小于1500字节的包是可以 的,大了就不行了。从广播改成组播也方便,要改的东西不多。