Re: UDP broadcasting problem



"Rain" <Rain@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote
But last night i tried sending 64kb message in the same loop for
30 times and all i recieved was 5 messages out of 30, im not sure
if i missed the other 25 messages or most of the messages sent
were not finished.

I would wager that the other 25 udp packets came in, but your code missed
them. In general, it's very rare to "lose" a UDP packets - especially if
you're on a LAN, or using the loopback address on your computerer.


Depening on the scalability of what you're doing, you're going to want to
either:
1 - (low scalability requirements, easier coding) create a UDP Listen thread
for each socket you're listening on and receive data that way.
2 - (high scalability, often confusing to newcomers) Use the Begin/End
methods on the sockets and do asynchronous programming. This scales very
well, is incredibly reliable, and (once you get the hang of it) is pretty
easy. The MS primers can be found at:
http://msdn2.microsoft.com/en-us/library/ms228969.aspx


--
Chris Mullins MCSD.Net, MCPD:Enterprise
http://www.coversant.net/blogs/cmullins


.



Relevant Pages

  • Twisted: UDP socket not closed.
    ... I have to send UDP packets very often. ... But socket is not closed after sending packet. ... def startProtocol: ... debug("Data client: ...
    (comp.lang.python)
  • Re: [UDP] Bind the local that is already in use
    ... I also make an experiment with two receivers and one sender. ... first socket will receive the traffic. ... "For UDP, Is it feasible and able to bind sockets to the same local address ... send UDP packets to the SAME remote address. ...
    (microsoft.public.win32.programmer.networks)
  • Re: Determine remote IP when using UDP Listener?
    ... I've created a new class "stateObject", fill it, pass it and extract the socket on Endreceive. ... But I can't read the RemoteEndPoint property when using _UDP_. ... UDP packets. ...
    (microsoft.public.dotnet.framework.compactframework)
  • Re: Losing UDP packets with MFC Sockets
    ... We are developing a tool which uses UDP packets to receive data from a UDP Server. ... The problem we have found is that some UDP packets are being lost when the PC's CPU is near 100% and we think that this problem is related to the Window's input buffer. ... Is there any way to change the input buffer size of the socket and store the received packet while the PC is processing other data? ...
    (microsoft.public.vc.mfc)
  • Re: !EventConnect Problem
    ... the June roll-up is available somewhere, although there's not been the usual ... The socket is not in a listening state. ... The incoming connection queue has no room for connections. ...
    (microsoft.public.windowsce.app.development)

Loading