31 :
folly::WriteChainAsyncTransportWrapper<
folly::AsyncTransportWrapper>(
60 "setReadCB() called with transport in bad state");
71 std::unique_ptr<folly::IOBuf>&& buf,
117 size_t available = 0;
118 while ((available = cursor.totalLength()) != 0 &&
readCallback_) {
125 }
catch (
const std::exception& e) {
128 folly::to<std::string>(
"getReadBuffer() threw ", e.what()));
133 "getReadBuffer() threw unknown exception");
136 if (buflen == 0 || buf ==
nullptr) {
139 "getReadBuffer() returned empty buffer");
143 size_t bytesToRead =
std::min(buflen, available);
144 cursor.pull(buf, bytesToRead);
147 if (available != 0) {
160 bool closeTransport) {
161 DelayedDestruction::DestructorGuard dg(
this);
169 readCallback->readErr(ex);
172 if (closeTransport) {
178 std::pair<void*, uint32_t> readSpace =
180 *bufReturn = readSpace.first;
181 *lenReturn = readSpace.second;
185 DelayedDestruction::DestructorGuard dg(
this);
198 DelayedDestruction::DestructorGuard dg(
this);
virtual void readBufferAvailable(std::unique_ptr< IOBuf >) noexcept
virtual void readDataAvailable(size_t len) noexcept=0
void append(std::unique_ptr< folly::IOBuf > &&buf, bool pack=false)
virtual void deliverError(const folly::AsyncSocketException &ex, bool closeTransport=true)
folly::IOBufQueue transportReadBuf_
static const uint32_t kMaxReadSize
size_t chainLength() const
std::unique_ptr< folly::IOBuf > appDataBuf_
ReadCallback * getReadCallback() const override
constexpr detail::Map< Move > move
EventBase * getEventBase()
AsyncFizzBase(folly::AsyncTransportWrapper::UniquePtr transport)
void readErr(const folly::AsyncSocketException &ex) noexceptoverride
virtual bool isBufferMovable() noexcept
virtual void startHandshakeTimeout(std::chrono::milliseconds)
—— Concurrent Priority Queue Implementation ——
requires E e noexcept(noexcept(s.error(std::move(e))))
bool good() const override=0
void readEOF() noexceptoverride
static const uint32_t kMinReadSize
std::pair< void *, std::size_t > preallocate(std::size_t min, std::size_t newAllocationSize, std::size_t max=std::numeric_limits< std::size_t >::max())
void setReadCB(ReadCallback *callback) override
virtual void cancelHandshakeTimeout()
void writeErr(size_t bytesWritten, const folly::AsyncSocketException &ex) noexceptoverride
~AsyncFizzBase() override
folly::AsyncTransportWrapper::UniquePtr transport_
std::unique_ptr< AsyncTransportWrapper, Destructor > UniquePtr
void writeSuccess() noexceptoverride
virtual void getReadBuffer(void **bufReturn, size_t *lenReturn)=0
void readDataAvailable(size_t len) noexceptoverride
void handshakeTimeoutExpired() noexcept
HandshakeTimeout handshakeTimeout_
void writeChain(folly::AsyncTransportWrapper::WriteCallback *callback, std::unique_ptr< folly::IOBuf > &&buf, folly::WriteFlags flags=folly::WriteFlags::NONE) override
size_t getAppBytesWritten() const override
virtual void startTransportReads()
bool isBufferMovable() noexceptoverride
std::size_t computeChainDataLength() const
void getReadBuffer(void **bufReturn, size_t *lenReturn) override
AsyncFizzClient::UniquePtr transport_
bool scheduleTimeout(uint32_t milliseconds)
void readBufferAvailable(std::unique_ptr< folly::IOBuf > data) noexceptoverride
size_t getAppBytesReceived() const override
static const uint32_t kMaxBufSize
AsyncSocketExceptionType getType() const noexcept
virtual void transportError(const folly::AsyncSocketException &ex)=0
void postallocate(std::size_t n)
virtual void readEOF() noexcept=0
virtual void transportDataAvailable()=0
static constexpr uint64_t data[1]
virtual void writeAppData(folly::AsyncTransportWrapper::WriteCallback *callback, std::unique_ptr< folly::IOBuf > &&buf, folly::WriteFlags flags=folly::WriteFlags::NONE)=0
ReadCallback * readCallback_
virtual void deliverAppData(std::unique_ptr< folly::IOBuf > buf)