G
Guest
i am writing an ActiveX control in c# that connects to a multicast. It works properly the problem is that when i run my webapp that contains the ActiveX control, then the broadcast is sent i do not receive the datagram for a minute and fourty five seconds. I need to be able to receive that datagram immediately.
I tried to change the size of the receive buffer to a smaller value, byte[] MessageBuffer = new Byte[10000
I immediately receive an error, A message sent on a datagram socket was larger than the internal message buffer or some other network limit, or the buffer used to receive a datagram was smaller than the datagram itself. When i make this buffer larger, byte[] MessageBuffer = new Byte[25000] i do not receive the error immediately, and i am stuck waiting to receive the data.
An important note about this problem is that once data has been received for the first time, i can run the multicast sender and i can receive just fine. it is just the problem of getting past that first hump. Any help would be greatly appreciated
this is called in this
_receiveSocket = new Socket(AddressFamily.InterNetwork,SocketType.Dgram,ProtocolType.Udp)
IPEndPoint ipept = new IPEndPoint(IPAddress.Any, _multiCastPort)
_receiveSocket.Bind(ipept)
IPAddress ip = IPAddress.Parse(_multiCastIP)
_receiveSocket.SetSocketOption(SocketOptionLevel.IP,SocketOptionName.AddMembership,new MulticastOption(ip))
byte[] MessageBuffer = new byte[25000]
_receiveSocket.ReceiveFrom(MessageBuffer,0,25000,SocketFlags.None,ref ep)
i have also tried to use a ucpclient for this and i still get the same problem.
I tried to change the size of the receive buffer to a smaller value, byte[] MessageBuffer = new Byte[10000
I immediately receive an error, A message sent on a datagram socket was larger than the internal message buffer or some other network limit, or the buffer used to receive a datagram was smaller than the datagram itself. When i make this buffer larger, byte[] MessageBuffer = new Byte[25000] i do not receive the error immediately, and i am stuck waiting to receive the data.
An important note about this problem is that once data has been received for the first time, i can run the multicast sender and i can receive just fine. it is just the problem of getting past that first hump. Any help would be greatly appreciated
this is called in this
_receiveSocket = new Socket(AddressFamily.InterNetwork,SocketType.Dgram,ProtocolType.Udp)
IPEndPoint ipept = new IPEndPoint(IPAddress.Any, _multiCastPort)
_receiveSocket.Bind(ipept)
IPAddress ip = IPAddress.Parse(_multiCastIP)
_receiveSocket.SetSocketOption(SocketOptionLevel.IP,SocketOptionName.AddMembership,new MulticastOption(ip))
byte[] MessageBuffer = new byte[25000]
_receiveSocket.ReceiveFrom(MessageBuffer,0,25000,SocketFlags.None,ref ep)
i have also tried to use a ucpclient for this and i still get the same problem.