Adding PortAllocator option to support cases where sockets can't be bound.

This CL adds the flag "PORTALLOCATOR_ENABLE_ANY_ADDRESS_PORTS", which will
force the creation of ports not bound to any specific network interface.
These are normally only used when network enumeration fails or is disabled,
but in some circumstances (such as the one the test case adds), they're the
only thing that works.

This will result in extra ports being gathered, which is why it's only enabled
behind a flag for now. In the future, we could probably introduce more
sophisticated "pruning" logic that would lessen the impact of the extra ports
when they're redundant, and make the flag the default.

Some other minor changes that were required to make this use case work:

* Allow a TCPPort to be used for outgoing connections even if it tries and
  fails to create a server socket.
* Allow Bind to fail if being called before Connect, and the IP is an "any"
  address (0.0.0.0 or ::), since this bind would have been mostly pointless
  anyway.
* Prevent P2PTransprotChannel from keeping a "backup" candidate pair using
  an "any address" network; we only want this for actual networks.

BUG=webrtc:7798

Review-Url: https://codereview.webrtc.org/2936553003
Cr-Commit-Position: refs/heads/master@{#18578}
11 files changed
tree: df408d607ef50f5de9316f074c5f271b5267163a
  1. build_overrides/
  2. data/
  3. infra/
  4. resources/
  5. tools_webrtc/
  6. webrtc/
  7. .clang-format
  8. .git-blame-ignore-revs
  9. .gitignore
  10. .gn
  11. AUTHORS
  12. BUILD.gn
  13. check_root_dir.py
  14. cleanup_links.py
  15. CODE_OF_CONDUCT.md
  16. codereview.settings
  17. DEPS
  18. LICENSE
  19. license_template.txt
  20. LICENSE_THIRD_PARTY
  21. OWNERS
  22. PATENTS
  23. PRESUBMIT.py
  24. pylintrc
  25. README.md
  26. WATCHLISTS
README.md

WebRTC is a free, open software project that provides browsers and mobile applications with Real-Time Communications (RTC) capabilities via simple APIs. The WebRTC components have been optimized to best serve this purpose.

Our mission: To enable rich, high-quality RTC applications to be developed for the browser, mobile platforms, and IoT devices, and allow them all to communicate via a common set of protocols.

The WebRTC initiative is a project supported by Google, Mozilla and Opera, amongst others.

Development

See http://www.webrtc.org/native-code/development for instructions on how to get started developing with the native code.

More info