[bind10-dev] Resend: Re: proposed system design and inter-process protocol for shared memory

Chen, Christof (AMOS SE) christof.chen at allianz.com
Fri Mar 8 08:08:48 UTC 2013



----- Originalnachricht -----
Von: Michal 'vorner' Vaner [mailto:michal.vaner at nic.cz]
Gesendet: Friday, March 08, 2013 08:52 AM
An: Francis Dupont <fdupont at isc.org>
Cc: bind10-dev at lists.isc.org <bind10-dev at lists.isc.org>
Betreff: Re: [bind10-dev] Resend: Re: proposed system design and inter-process protocol for shared memory

Hello

On Thu, Mar 07, 2013 at 07:48:54PM +0000, Francis Dupont wrote:
> > > BTW please remember PF_UNIX SOCK_STREAM provides really a stream
> > > so doesn't preserve packet boundaries! If for instance you use one
> > > to send two control messages in two send()s, a recv()s at the
> > > other end can return the first message or both. I had already
> > > a trouble with this (solved by moving to SOCK_DGRAM which was
> > > I needed in fact) and of course debugging had enough impact
> > > to never show this phenomenon (:-)...
> > 
> > Don't worry, we use it that way. We have a 4-byte length prefix with each
> > message and then that many bytes are the message. And we do retry the read
> > if it reads less that as many bytes.
> 
> => reread my message: the issue is not less but more, so not about
> retry but about possible tail recursion of the decoding routine.

Actually, less is more problematic. You specify the maximum amount of data to
read by recv, it won't return more.

> > > A final note: PF_UNIX is UNIX, not POSIX. So it is NOT portable.
> > > TCP to 127.0.0.1 or ::1 provides the same abstraction and is
> > > portable (at the exception of the Windows 8 modern UI where it
> > > is a privileged operation but this environment will *never*
> > > support a "desktop" application like BIND 10).
> > 
> > And it also creates problems when running multiple instances from multiple
> > directories and may be slower and we would need authentication on it.
> 
> => what is the "it" here? TCP has nothing to do with directories,
> is slower than PF_UNIX SOCK_STREAM and offers less access control.

„It“ means listening on localhost. You'd need some fixed port number and the two
instances would fight each other (or you'd need to specify a port explicitly,
which is not convenient). With the unix sockets, you can be relative to the
directory you live in, so you won't collide.

With regards

-- 
BOFH Excuse #452:
Somebody ran the operating system through a spelling checker.

Michal 'vorner' Vaner


More information about the bind10-dev mailing list