void Cpp2Channel::readException(Context* ctx, folly::exception_wrapper e) { DestructorGuard dg(this); VLOG(5) << "Got a read error: " << folly::exceptionStr(e); if (recvCallback_) { recvCallback_->messageReceiveErrorWrapped(std::move(e)); } processReadEOF(); }
void Cpp2Channel::readError(const TTransportException & ex) noexcept { DestructorGuard dg(this); VLOG(5) << "Got a read error: " << folly::exceptionStr(ex); if (recvCallback_) { recvCallback_->messageReceiveError(make_exception_ptr(ex)); } processReadEOF(); }
void Cpp2Channel::closeNow() { // closeNow can invoke callbacks DestructorGuard dg(this); closing_ = true; transport_->setReadCallback(NULL); transport_->closeNow(); processReadEOF(); // Call failure callbacks }
folly::Future<folly::Unit> Cpp2Channel::close(Context* ctx) { DestructorGuard dg(this); if (transport_) { // If transport is taken over, no need to call processReadEOF. This can // happen when processing HTTP GET request, where the ownership of the // socket is transferred to GetHandler. processReadEOF(); } return ctx->fireClose(); }
void Cpp2Channel::readEOF(Context* ctx) { processReadEOF(); }
void Cpp2Channel::readEOF() noexcept { processReadEOF(); }
folly::Future<void> Cpp2Channel::close(Context* ctx) { DestructorGuard dg(this); processReadEOF(); return ctx->fireClose(); }