Re: Sockets best for real-time?
- From: "Roddy Pratt" <roddy at spam fritter dot com>
- Date: Tue, 13 Jun 2006 15:01:48 +0100
"Guillem" <guillemvicens-nospam@xxxxxxxxxxxxxxxxxx> wrote in message
news:xn0enfizsdkovk002@xxxxxxxxxxxxxxxxxxxxxxxxx
Arthur Hoornweg wrote:
The disadvantage of UDP is that there's no guarantee that a packet
doesn't get lost.
that's the reason I did not even mention it. Personally I think this
point could be a serious problem for a RTS
It's worth clarifying this: Packet loss AT THE ETHERNET LEVEL is a fact of
life with ALL network protocols, including TCP. A dedicated full-duplex
point-to-point link between two machines should mean that packet loss is
'practically' not a problem, but you don't really have a true network then.
Where UDP and TCP differ is their approach to packet loss: TCP guarantees
data delivery by retransmitting lost packets, while UDP does not. You can
add simple retransmission capabilities to UDP protocols, particularly if you
just have a command-packet/response-packet style of comms. And TCP's secure
redelivery costs time and bandwidth.
With TCP, the time taken to deliver or receive a packet is essentially under
control of the network stack, not the programmer. With UDP, you can control
a lot more yourself, making it very suitable for many simple realtime
systems.
However, IMO, unless you absolutlely need the 'simplicity' and low-level
control that UDP (or your own IP-based protocol) gives you, stick with TCP.
And, if you want to optimise responsiveness with TCP/IP, you must understand
the Nagle (TCP_NODELAY) flag!
Either way, make sure you know how to use Ethereal. It will be your best
friend!
- Roddy
.
- Follow-Ups:
- Re: Sockets best for real-time?
- From: ozbear
- Re: Sockets best for real-time?
- From: Guillem
- Re: Sockets best for real-time?
- References:
- Sockets best for real-time?
- From: Blackbird Crow Raven
- Re: Sockets best for real-time?
- From: Marc Rohloff [TeamB]
- Re: Sockets best for real-time?
- From: Blackbird Crow Raven
- Re: Sockets best for real-time?
- From: Guillem
- Re: Sockets best for real-time?
- From: Arthur Hoornweg
- Re: Sockets best for real-time?
- From: Guillem
- Sockets best for real-time?
- Prev by Date: Re: What is object oriented programming?
- Next by Date: Re: What is object oriented programming?
- Previous by thread: Re: Sockets best for real-time?
- Next by thread: Re: Sockets best for real-time?
- Index(es):
Relevant Pages
|
|