介绍:
原来在2000pro,2000server上跑的好好的UDP广播程序,现在移植到XP和2003下跑。结果:
客户端接受不到广播数据了。需要解决!问题分析:
由于广播的是视频数据,所以广播数据量很大,原来在2000下跑得很正常。有人说是XP、2003中对UDP广播有限制,不知道是不是这样?如果是,如何设置?
原来在2000pro,2000server上跑的好好的UDP广播程序,现在移植到XP和2003下跑。结果:
客户端接受不到广播数据了。需要解决!问题分析:
由于广播的是视频数据,所以广播数据量很大,原来在2000下跑得很正常。有人说是XP、2003中对UDP广播有限制,不知道是不是这样?如果是,如何设置?
要不自己写一个基于UDP的协议?
up.
应该不会有这样的问题啊。
发送缓冲区加大?如何做啊?不太明白你的意思 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.