libevent/libevent — pull request #179 by pysiak (2014-10-13 15:40:30+00:00)
Title: Provide support for SO_REUSEPORT through LEV_OPT_REUSABLE_PORT

We have LEV_OPT_REUSABLE to provide a socket option SO_REUSEADDR.
Linux 3.9+ has support for a new socket option SO_REUSEPORT [1] which allows multiple servers to actually listen on the same socket.

Now, I've encountered an application which is using evconnlistener_new_bind() with LEV_OPT_REUSABLE but I needed it to have SO_REUSEPORT. Because you have to set SO_REUSEPORT before you bind it makes the whole process more klunky.

Instead of a one clean
```
evconnlistener_new_bind();
```

I'd have to:
```
socket();
evutil_make_socket_nonblocking();
setsockopt();
evconn_listener_new();
bind();
```

This patch introduces new LEV_OPT_REUSABLE_**PORT** so that you can use evconn_listener_new_bind() to set **SO_REUSEPORT** in one go.

Because SO_REUSEADDR and SO_REUSEPORT do not imply each other, I decided to make them separate options as well. More info at [2].

Please review this patch.

[1] http://lwn.net/Articles/542629/
[2] http://stackoverflow.com/questions/14388706/socket-options-so-reuseaddr-and-so-reuseport-how-do-they-differ-do-they-mean-t