tech-net archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

How (un)reliable are local domain sockets?



Hello,

   Say I'm adding the necessary ACK's, retries, etc to a UDP based
protocol, and I want to support local domain sockets as well (also
SOCK_DGRAM). Do I need to keep the "error handling" from the UDP code,
or are local domain sockets guaranteed to be successful as long as
sendto() was successful?

   I found this:
http://stackoverflow.com/questions/1566980/how-reliable-are-unix-domain-sockets

   ..which has the magic "as on most Unix implementations" words in it,
which doesn't say much, unfortunately.

   It wouldn't be difficult (in fact, it would be pretty trivial) to
simply rewire the code so that larger packets are used for local domain
sockets, but apart from that the code is more or less identical.
However, if the new code would - in practice - never need to resend any
packets, I would prefer to allow the code path for local domain sockets
to be only as complex as it actually needs to be.

   Perhaps I should add support for both, and simply use a macro to
switch between modes. But the question remains: On NetBSD, are they
reliable?

-- 
Kind regards,
Jan Danielsson



Home | Main Index | Thread Index | Old Index