ryandotsmith/log-shuttle — pull request #12 by fabiokung (2012-11-30 00:31:28+00:00)
Title: Consider datagram-type unix sockets

The `unix` connection type in `net.Listen(...)` means a unix socket of type `SOCK_STREAM` (source code [here](http://golang.org/src/pkg/net/unixsock_posix.go#L17)).

By its definition, `SOCK_STREAM` avoids duplication, loss and guarantees the order of messages. It can generate `SIGPIPE`, `ETIMEOUT` and other errors described [here](http://publib.boulder.ibm.com/infocenter/pseries/v5r3/index.jsp?topic=/com.ibm.aix.progcomm/doc/progcomc/skt_types.htm).

`SOCK_DGRAM` is a simpler type of socket (more similar to a simple message queue). It doesn't provide any strong guarantees (messages can be delivered out of order, dropped or duplicated), but seems to be good enough for our logging purposes. Plus, it would avoid problems in the log pipeline affecting or blocking dynos. It's analogue to UDP sockets: fire and forget.

In practice, it seems that the implementation on Linux will not deliver messages out of order anyway.

More info: [`unix(7)`](http://linux.die.net/man/7/unix) and [`socket(2)`](http://linux.die.net/man/2/socket).