RE: Losing UDP packets with MFC Sockets
- From: "Xepol" <Xepol@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Sat, 16 Apr 2005 13:40:02 -0700
UDP is connectionless, as such it does not assure reliable delivery. If you
need reliably delivery of packets you need to use TCP -PERIOD-.
If your TCP/IP stack is full (for example if the cpu is bogged and your task
isn't able to keep it empty), incoming UDP packets will be discarded. The
originating end does not get notified. That is how UDP is supposed. If you
were using TCP, a negotiation would take place, the sender would get
squelched and would keep resending the packets until your end could receive
it, at which point everything would move forward again.
Frankly, I have a hell of a time hitting 100% on my CPU, even downloading,
RAR unpacking, MP3s playing and 2 virtual PCs going at the same time, so I
gotta ask what sort of system abusing tasks you've found!
Oh, incidently, changing some numbers in the TPC stack can actually make
things MUCH MUCH worse ( changing your window size for example can actually
make it impossible for the packets to get past some routers/gateways as they
don't handle larger packet windows)
Increasing the size of your buffer would merely delay the inevitable. If
your task is seriously CPU starved, you might find that you just end up with
a larger filled buffer instead of a solution.
If delivery is required, ALWAYS use TCP. If you can't use TCP for other
reasons, you might have to simulate a connection by having your sender resend
every packet until it receives an ACK in return (but you run the possibility
of the sender missing an ACK and resending a packet too)
- Clinton R. Johnson
.
- Follow-Ups:
- RE: Losing UDP packets with MFC Sockets
- From: Vicent Soler
- RE: Losing UDP packets with MFC Sockets
- References:
- Losing UDP packets with MFC Sockets
- From: Vicent Soler
- Losing UDP packets with MFC Sockets
- Prev by Date: memory leak
- Next by Date: Re: memory leak
- Previous by thread: Re: Losing UDP packets with MFC Sockets
- Next by thread: RE: Losing UDP packets with MFC Sockets
- Index(es):
Relevant Pages
|