Re: UDP broadcasting problem
- From: "Chris Mullins" <cmullins@xxxxxxxxx>
- Date: Sat, 26 Aug 2006 10:56:55 -0700
"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
.
- Follow-Ups:
- Re: UDP broadcasting problem
- From: Rain
- Re: UDP broadcasting problem
- Prev by Date: Best way to maintain settings?
- Next by Date: Re: Team Foundation Server not on Team Suite DVD?
- Previous by thread: Best way to maintain settings?
- Next by thread: Re: UDP broadcasting problem
- Index(es):
Relevant Pages
|
Loading