mirror of
https://github.com/facebookincubator/mvfst.git
synced 2025-11-10 21:22:20 +03:00
Summary: mvfst will need to handle pmtu in an app specific way. So just set DF bits but not pmtu. Reviewed By: siyengar Differential Revision: D17624134 fbshipit-source-id: 14f445bbb6a971efb8a3d550c84c3d4af53f8517
33 lines
803 B
C++
33 lines
803 B
C++
/*
|
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <quic/server/QuicUDPSocketFactory.h>
|
|
|
|
namespace quic {
|
|
|
|
class QuicSharedUDPSocketFactory : public QuicUDPSocketFactory {
|
|
public:
|
|
~QuicSharedUDPSocketFactory() override {}
|
|
QuicSharedUDPSocketFactory() {}
|
|
|
|
std::unique_ptr<folly::AsyncUDPSocket> make(folly::EventBase* evb, int fd)
|
|
override {
|
|
auto sock = std::make_unique<folly::AsyncUDPSocket>(evb);
|
|
if (fd != -1) {
|
|
sock->setFD(
|
|
folly::NetworkSocket::fromFd(fd),
|
|
folly::AsyncUDPSocket::FDOwnership::SHARED);
|
|
sock->setDFAndTurnOffPMTU();
|
|
}
|
|
return sock;
|
|
}
|
|
};
|
|
} // namespace quic
|