Summary:
Original diff
D1800100, reverted in
D1895181. Issue seems to have been caused by a copy constructor issue.
Fixes: Remove copy constructor, move contructor only. Separate stop() and join(), since join() can happen only after all stop()s have completed when reusing the same IOThreadPoolExecutors.
Test Plan: build and unit tests of relevant product
Reviewed By: praveenr@fb.com
Subscribers: trunkagent, doug, fugalh, alandau, bmatheny, mshneer, folly-diffs@, jsedgwick, yfeldblum
FB internal diff:
D1901718
Tasks:
6431975
Signature: t1:
1901718:
1426885577:
46b63bfe117df207be3d273b953c100249c1a7da
Blame Revision:
D1895181
}
}
- void bind(const folly::SocketAddress& address) {
+ void bind(const folly::SocketAddress& addy) {
CHECK(!socket_);
socket_ = folly::make_unique<AsyncUDPSocket>(evb_);
- socket_->bind(address);
+ socket_->bind(addy);
}
folly::SocketAddress address() const {
class ServerBootstrap {
public:
+ ServerBootstrap(const ServerBootstrap& that) = delete;
+ ServerBootstrap(ServerBootstrap&& that) = default;
+
+ ServerBootstrap() {}
+
~ServerBootstrap() {
stop();
+ join();
}
typedef wangle::ChannelPipeline<
new_sockets.push_back(socket);
sock_lock.unlock();
- if (port == 0) {
+ if (port <= 0) {
socket->getAddress(&address);
port = address.getPort();
}
barrier.wait();
}
sockets_.clear();
+ }
+ void join() {
if (acceptor_group_) {
acceptor_group_->join();
}