ScopedBoundPort
authorYedidya Feldblum <yfeldblum@fb.com>
Tue, 16 Aug 2016 02:39:44 +0000 (19:39 -0700)
committerFacebook Github Bot <facebook-github-bot-bot@fb.com>
Tue, 16 Aug 2016 02:53:26 +0000 (19:53 -0700)
commit6ba2117b74f6b4ebec8d1b9ab771d77e35a252e4
tree6c9bcdfe6264f264f429ecfc7f2474376612b615
parent74d1af87831f9df2b5cb9d104db1d0e2edab591e
ScopedBoundPort

Summary:
[Folly] `ScopedBoundPort`.

An RAII class for `bind`ing, but not `listen`ing, an ephemral port.

Useful when there is a need to test server-down cases - in such cases, a guaranteed-not-listening port is required.

Extracted from a unit-test in Thrift; switches the Thrift test to use this extracted implementation instead.

Reviewed By: djwatson

Differential Revision: D3714293

fbshipit-source-id: 649fba1a0b7f0519b8297a3183d03c5dde23ddc6
folly/Makefile.am
folly/io/async/AsyncServerSocket.h
folly/io/async/test/ScopedBoundPort.cpp [new file with mode: 0644]
folly/io/async/test/ScopedBoundPort.h [new file with mode: 0644]