views:

180

answers:

1

When running a C# app I created on XP it runs just fine, but under Windows 7, I get the following error:

"An operation on a socket could not be performed because the system lacked sufficient buffer space or because a queue was full"

I am doing the following:

socket = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);

socket.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ReuseAddress, true);
IPAddress localIPAddr = IPAddress.Any;
EndPoint localEP = new IPEndPoint(localIPAddr, MulticastPort);
socket.Bind(localEP);
MulticastOption mcastOption = new MulticastOption(MulticastAddress, localIPAddr);

socket.SetSocketOption(SocketOptionLevel.IP, SocketOptionName.AddMembership, mcastOption);

byte[] bytes = new Byte[40960];

The error happens on the second last line socket.SetSocketOption(...)

You'll notice I'm doing UDP multicasting, is there something I need to do for Windows 7 to allow this?

A: 

IIRC, joining a multicast group does require an additional privilege since you are modifying a kernel level table. I cannot recall which privilege it is though.

D.Shawley