Add REUSEPORT option to AsyncServerSocket
authorDave Watson <davejwatson@fb.com>
Mon, 1 Dec 2014 20:52:35 +0000 (12:52 -0800)
committerDave Watson <davejwatson@fb.com>
Thu, 11 Dec 2014 16:01:24 +0000 (08:01 -0800)
commit010f9408de33dfbc932fee232200066031ac9621
tree0e52415c7db5799e897b138d037c47df92aa4604
parente43f826e136bf52883e28e3dbdaa0f9dbe227c92
Add REUSEPORT option to AsyncServerSocket

Summary:
Adds a reuse port option to AsyncServerSocket, so multiple sockets can bind to the same accept port.  Allows for multiple accept threads, so accepts can be greater, since there is no longer a single accept lock.

reuse port option is ifdefd, since this wouldn't build with some of the older kernels otherwise.

Postponed overnight

Test Plan: Builds.  Used in an upcoming diff.

Reviewed By: jsedgwick@fb.com

Subscribers: benj, trunkagent, doug, njormrod, folly-diffs@

FB internal diff: D1710600

Tasks: 54885165788110

Signature: t1:1710600:1418066966:627e03857f9b5ff831f2922add08e90cc525c95c
folly/io/async/AsyncServerSocket.cpp
folly/io/async/AsyncServerSocket.h
folly/io/async/test/AsyncSocketTest.cpp