Subject: Re: unix domain datagram socket buffering bug?
To: None <firstname.lastname@example.org>
From: Matthew Mondor <email@example.com>
Date: 04/21/2003 12:12:50
On Thu, Apr 10, 2003 at 10:28:52PM -0400, Gary Duzan wrote:
> In Message <firstname.lastname@example.org> ,
> Matt Thomas <email@example.com> wrote:
> =>At 09:05 AM 4/10/2003, David Laight wrote:
> =>>On Thu, Apr 10, 2003 at 09:02:59AM -0700, Jesse Off wrote:
> =>> > When the receive buffer fills in one socket from a
> =>> > socketpair(PF_LOCAL, SOCK_DGRAM), I've noticed that
> =>> > subsequent write()s to the other socket will fail with
> =>> > EINVAL.
> =>>I would expect it to block, unless O_NONBLOCK is set
> =>>in which case it should return EAGAIN.
> =>I'd never would have expected socketpair to work with
> I've done that before (though on AIX) when I wanted a pipe-like
> behavior, but preserving datagram boundaries. It saved me from
> having to wrap my own framing protocol, and it Just Worked.
> Gary Duzan
I used datagrams over socketpair() on both NetBSD and Linux so far
without problems and it indeed seemed an ideal solution for what I needed
at the time, as opposed to a stream which would have been considered higher
overhead (although this yet has to be proven kernel-wise as I did not perform
any benchmarks on this)...