[bind10-dev] Resend: Re: proposed system design and inter-process protocol for shared memory
Michal 'vorner' Vaner
michal.vaner at nic.cz
Fri Mar 8 07:52:21 UTC 2013
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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <https://lists.isc.org/pipermail/bind10-dev/attachments/20130308/c516348b/attachment.bin>
More information about the bind10-dev
mailing list