[erlang-questions] gen_tcp:send(Sock, SmallPacket) issue

David Mercer dmercer@REDACTED
Wed Jun 20 16:31:28 CEST 2007

Dave Smith  wrote:
> It is my _opinion_ that many people
> new to network/protocol development jump on the UDP bandwagon too
> early, without considering the long term ramifications of having to
> implement/maintain a protocol that is based on an unreliable,
> unordered delivery transport.  That said, there are situations where
> UDP is far more appropriate than TCP, particularly when one is more
> concerned with latency than reliability.

My own personal experience has been the opposite: that I have defaulted to
using TCP because that is the more popular protocol, and it is touted as
being more reliable than UDP.  However, most ad hoc protocols require some
sort of acknowledgement from the receiving application.  If the receiving
application is sending an ack anyway, and you're going to rely on that
rather than just assuming TCP is reliable, then why not drop TCP altogether
in favor of its faster cousin, UDP?  With the caveat that your messages must
be short enough to fit in a single datagram, so that you do not have to
implement message reassembly at the receiving application or anything like

That being said, I continue to use TCP over UDP because of momentum, and
because of what Mr. Smith said about the "long term ramifications."

I assume Erlang uses TCP for its internode communication.  Is there a
description anywhere about how this works (esp. what ports are used)?

More information about the erlang-questions mailing list