1
0
mirror of https://github.com/facebookincubator/mvfst.git synced 2025-11-10 21:22:20 +03:00
Files
mvfst/quic/server/QuicSharedUDPSocketFactory.h
Udip Pant e3b792e7f1 set IP_PMTUDISC_PROBE instead of dontFragment (i.e. PMTUDISC_DO)
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
2019-09-27 13:14:33 -07:00

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