250bpm/nanomsg — pull request #101 by tailhook (2013-08-21 19:15:37+00:00)
Title: The tcp+fd transport

First implementation of `tcp+fd` transport. The address has the following format:
```
tcp+fd://1234
```
When `nn_bind()` receives this address, it expects an `1234` to be posix file descriptor for tcp socket which has already `bind()` and `listen()` executed on it. When `nn_connect()` receives this kind of socket it expects file descriptor to be established connection (either after calling `connect()` or got from `accept()`).

In this implementations you can feed the socket immediately after calling `connect()` without waiting for connection to be established. It's unclear whether this will stay.

It's untested, but probably any stream socket will work with `tcp+fd` not only TCP one. The only limitation is that listening one would be for `nn_bind` and established one for `nn_connect` (or even a pipe). Given that interface is intended for experienced users, it will probably stay this way.

Patch is not ready yet. In particular I'm pretty sure there are issues with connection shutdown. I'm publishing it as a pull request just for easier reviewing. I will also rebase/squash the changes when they are ready.