Add specific multi-bind to AsyncServerSocket
Summary:
Add a bind api similar to binding by port across all interfaces.
However, this bind will only attempt to bind sockets to the supplied
IP addresses. I'd like to add this to aid in moving TURN to IPv6.
TURN will use two specified addresses, one for IPv4, and one for IPv6, to
handle incoming connections from clients. In order to avoid duplicating
workers, we'd like to take advantage of the multi-socket implementation
of AsyncServerSocket. However, we don't want to bind to all interfaces,
especially for port 443.
Test Plan:
Plan to test by adapting TurnTcpListener to use this new API. See that
1. using one address still works as expected,
2. using zero addesses will cause exception
3. using multiple addresses works as expected
Will write unit tests if needed
Reviewed By: davejwatson@fb.com
Subscribers: hannesr, trunkagent, net-systems@, folly-diffs@, naizhi
FB internal diff:
D1729442
Tasks:
3633642
Signature: t1:
1729442:
1418752467:
22a60da4ec9009ea0b7fe28a8a436a179e0449aa