Metaswitch/clearwater-infrastructure — pull request #117 by AlexHockey (2014-12-11 17:57:20+00:00)
Title: [Reviewer: Andy] Create a socket factory daemon

Andy, please can you review this code to introduce a new daemon process that creates sockets in the default namespace and passed them to clients over a named socket.

This consists of the following pieces:

* The daemon code.
* An upstart job to start and respawn the daemon.
* An example client to test the daemon.
* Code to build a new `clearwater-socket-factory` package as part of building `clearwater-infrastructure`

I have tested this as follows:

* Install the new package, check daemon is running.
* Kill the daemon, it restarts immediately.
* Run `sudo stop clearwater-socket-factory`. The daemon stops promptly. Run `sudo start clearwater-socket-factory` and it starts again.
* Use the test program to connect to a server that is listening with netcat.
* Try to connect to a server that is not listening. This fails after a timeout.
* Try to connect to a bad hostname (not resolvable in DNS). This fails promptly.