Skip to content

Commit c3bb450

Browse files
Sujay Patelfacebook-github-bot
authored andcommitted
Implemented MoQServer initialization with specified eventbases
Summary: Added updates to MoQServer and HQServer to allow to pass in a std::vector<folly::Eventbase*> param to start a quicserver on it. Reviewed By: sharmafb Differential Revision: D78365120 fbshipit-source-id: 52e4e7760b0cf0328508d09c238a093a564a0f73
1 parent 1333652 commit c3bb450

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

third-party/proxygen/src/proxygen/httpserver/samples/hq/HQServer.cpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -267,14 +267,20 @@ HQServer::HQServer(HQServerParams params,
267267
}
268268
}
269269

270-
void HQServer::start() {
270+
void HQServer::start(std::vector<folly::EventBase*> evbs) {
271271
folly::SocketAddress localAddress;
272272
if (params_.localAddress) {
273273
localAddress = *params_.localAddress;
274274
} else {
275275
localAddress.setFromLocalPort(params_.port);
276276
}
277-
server_->start(localAddress, params_.serverThreads);
277+
278+
if (evbs.empty()) {
279+
server_->start(localAddress, params_.serverThreads);
280+
} else {
281+
server_->initialize(localAddress, evbs, true);
282+
server_->start();
283+
}
278284
}
279285

280286
const folly::SocketAddress HQServer::getAddress() const {

third-party/proxygen/src/proxygen/httpserver/samples/hq/HQServer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class HQServer {
3737
std::unique_ptr<quic::QuicServerTransportFactory> factory);
3838

3939
// Starts the QUIC transport in background thread
40-
void start();
40+
void start(std::vector<folly::EventBase*> evbs = {});
4141

4242
// Returns the listening address of the server
4343
// NOTE: can block until the server has started

0 commit comments

Comments
 (0)