diff options
author | rwatson <rwatson@FreeBSD.org> | 2009-10-05 14:49:16 +0000 |
---|---|---|
committer | rwatson <rwatson@FreeBSD.org> | 2009-10-05 14:49:16 +0000 |
commit | 8579778ae2948fcdd0cb45f3e198f5eb67ec88a1 (patch) | |
tree | d7e9e06f7bce4f7f754de227f463f37bcc1a43fd /usr.bin/netstat/unix.c | |
parent | 9d270810482b03835088730678541f0c11cfb068 (diff) | |
download | FreeBSD-src-8579778ae2948fcdd0cb45f3e198f5eb67ec88a1.zip FreeBSD-src-8579778ae2948fcdd0cb45f3e198f5eb67ec88a1.tar.gz |
First cut at implementing SOCK_SEQPACKET support for UNIX (local) domain
sockets. This allows for reliable bi-directional datagram communication
over UNIX domain sockets, in contrast to SOCK_DGRAM (M:N, unreliable) or
SOCK_STERAM (bi-directional bytestream). Largely, this reuses existing
UNIX domain socket code. This allows applications requiring record-
oriented semantics to do so reliably via local IPC.
Some implementation notes (also present in XXX comments):
- Currently we lack an sbappend variant able to do datagrams and control
data without doing addresses, so we mark SOCK_SEQPACKET as PR_ADDR.
Adding a new variant will solve this problem.
- UNIX domain sockets on FreeBSD provide back-pressure/flow control
notification for stream sockets by manipulating the send socket
buffer's size during pru_send and pru_rcvd. This trick works less well
for SOCK_SEQPACKET as sosend_generic() uses sb_hiwat not just to
manage blocking, but also to determine maximum datagram size. Fixing
this requires rethinking how back-pressure is done for SOCK_SEQPACKET;
in the mean time, it's possible to get EMSGSIZE when buffers fill,
instead of blocking.
Discussed with: benl
Reviewed by: bz, rpaulo
MFC after: 3 months
Sponsored by: Google
Diffstat (limited to 'usr.bin/netstat/unix.c')
0 files changed, 0 insertions, 0 deletions