netdev
[Top] [All Lists]

[PATCH] Add SOCK_SEQPACKET to PF_UNIX protocol family

To: netdev@xxxxxxxxxxx
Subject: [PATCH] Add SOCK_SEQPACKET to PF_UNIX protocol family
From: Steven Dake <scd@xxxxxxxxxx>
Date: Sat, 28 Feb 2004 00:19:23 -0700
Organization: Broked Software Foundation
Reply-to: scd@xxxxxxxxxx
Sender: netdev-bounce@xxxxxxxxxxx
Folks,

Attached is a patch which adds SOCK_SEQPACKET to the PF_UNIX protocol
family.  It doesn't seem to break SOCK_STREAM or SOCK_DGRAM for PF_UNIX
and adds the desired functionality.  I could find alot of questions
about "is this supported" but only one response stating as of yet it is
not.

SOCK_DGRAM doesn't work on connected sockets.  Using SOCK_STREAM for
connection oriented sockets requires the application to frame if
variable length messages are desired.

This patch provides the best of both of those protocols by following the
SOCK_SEQPACKET semantics of allowing datagrams over connected PF_UNIX
sockets.

SOCK_SEQPACKET provides several advantages over SOCK_STREAM or
SOCK_DGRAM:
1. only one system call (vs two for SOCK_STREAM) is required for
variable length messages, no framing is required
2. the end of a large message can be discarded without processing if the
application is only interested in the beginning of the message.
3. connected fds can be used to uniquely identify a connection. (the
kernel is used to ensure application security).

Comments welcome, enjoy

-steve

Attachment: linux-2.6.3-af_unix-sockseqpacket.patch
Description: Text document

<Prev in Thread] Current Thread [Next in Thread>