The unix-stream() and unix-dgram()
drivers open an AF_UNIX socket and start listening on it for
messages. The unix-stream() driver is primarily used on Linux
and uses SOCK_STREAM semantics (connection oriented, no
messages are lost); while unix-dgram() is used on BSDs and
uses SOCK_DGRAM semantics: this may result in lost local
messages if the system is overloaded.
To avoid denial of service attacks when using connection-oriented protocols, the
number of simultaneously accepted connections should be limited. This can be
achieved using the max-connections() parameter. The default
value of this parameter is quite strict, you might have to increase it on a busy
system.
Both unix-stream and unix-dgram have a single required argument that specifies the filename of the socket to create. For the list of available optional parameters, see Section 8.1.8, “unix-stream() and unix-dgram()”
Declaration:
unix-stream(filename [options]);
unix-dgram(filename [options]);
![]() |
Note |
|---|---|
|
The difference between the unix-stream and unix-dgram drivers is similar to the difference between the TCP and UDP network protocols. Use the following guidelines to select which driver to use in a particular situation:
Choose unix-stream if you would choose TCP (stream) instead of UDP (datagram). The unix-stream driver offers the following features:
Increased reliability
Ordered delivery of messages
Client-side notification of failures
Choose unix-dgram if you would choose TCP (stream) over UDP (datagram). The unix-dgram driver offers the following features:
Decreased possibility of Dos by opening too many connections (a local vulnerability)
Less overhead
However, the client does not notice if a message is lost when using the unix-dgram driver.
© 2007-2010 BalaBit IT Security
Please send your comments or documentation bugs to: documentation@balabit.com