mirror of
https://github.com/facebookincubator/mvfst.git
synced 2025-04-18 17:24:03 +03:00
Summary: - as title Reviewed By: lnicco Differential Revision: D33513410 fbshipit-source-id: 282b6f512cf83b9abb7990402661135b658f7bd1
48 lines
1.5 KiB
C++
48 lines
1.5 KiB
C++
/*
|
|
* Copyright (c) Meta Platforms, Inc. and 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/api/QuicStreamAsyncTransport.h>
|
|
#include <quic/client/QuicClientTransport.h>
|
|
|
|
namespace quic {
|
|
|
|
/**
|
|
* Adaptor from QuicClientTransport to folly::AsyncTransport,
|
|
* for experiments with QUIC in code using folly::AsyncSockets.
|
|
*/
|
|
class QuicClientAsyncTransport : public QuicStreamAsyncTransport,
|
|
public QuicSocket::ConnectionCallback {
|
|
public:
|
|
using UniquePtr = std::unique_ptr<
|
|
QuicClientAsyncTransport,
|
|
folly::DelayedDestruction::Destructor>;
|
|
explicit QuicClientAsyncTransport(
|
|
const std::shared_ptr<QuicClientTransport>& clientSock);
|
|
|
|
protected:
|
|
~QuicClientAsyncTransport() override = default;
|
|
|
|
//
|
|
// QuicSocket::ConnectionCallback
|
|
//
|
|
void onNewBidirectionalStream(StreamId id) noexcept override;
|
|
void onNewUnidirectionalStream(StreamId id) noexcept override;
|
|
void onStopSending(StreamId id, ApplicationErrorCode error) noexcept override;
|
|
void onConnectionEnd() noexcept override;
|
|
void onConnectionSetupError(
|
|
std::pair<QuicErrorCode, std::string> code) noexcept override {
|
|
onConnectionError(std::move(code));
|
|
}
|
|
void onConnectionError(
|
|
std::pair<QuicErrorCode, std::string> code) noexcept override;
|
|
void onTransportReady() noexcept override;
|
|
};
|
|
} // namespace quic
|