views:

29

answers:

2

Can local message-based sockets transfer messages up to the SO_SNDBUF/SO_RCVBUF limits, or where can the so-called 'fixed maximum length' be determined for a descriptor created with socket(PF_UNIX, SOCK_SEQPACKET, 0) or socket(PF_UNIX, SOCK_DGRAM, 0)?

A: 

Your datagrams will be queued in the socket send/receive buffers up to a maximum of SO_SNDBUF and SO_RCVBUF respectively. Datagrams will be discarded past this limit.

Note that datagrams do not have the exact size of the data you put in them.

I don't really remember, but I think you can tweak those settings. It's always wiser, though, to do your own buffering when dealing with UDP sockets.

edit: sorry about that, right you are. This might be of use:

The SO_SNDBUF socket option does have an effect for Unix domain sock- ets, but the SO_RCVBUF option does not. For datagram sockets, the SO_SNDBUF value imposes an upper limit on the size of outgoing data- grams. This limit is calculated as the doubled (see socket(7)) option value less 32 bytes used for overhead

Santiago Lezica
These aren't UDP sockets. PF_UNIX (AF_UNIX) rather than PF_INET or PF_INET6 (AF_INET or AF_INET6)
nategoose
Oh, sorry! There you go, edited.
Santiago Lezica
+1  A: 

from man unix

The SO_SNDBUF socket option does have an effect for Unix domain sock‐ ets, but the SO_RCVBUF option does not. For datagram sockets, the SO_SNDBUF value imposes an upper limit on the size of outgoing data‐ grams. This limit is calculated as the doubled (see socket(7)) option value less 32 bytes used for overhead.

nategoose
That's what I'm looking for, thanks! My RHEL4-based box didn't have anything in the 'unix', 'un.h', or any of the socket-related man pages (all dated late '02/early '03), so I gave up looking a bit prematurely.
Jeff