Beispiel #1
0
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();
}
Beispiel #2
0
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();
}
Beispiel #3
0
void Cpp2Channel::closeNow() {
  // closeNow can invoke callbacks
  DestructorGuard dg(this);
  closing_ = true;
  transport_->setReadCallback(NULL);
  transport_->closeNow();

  processReadEOF(); // Call failure callbacks
}
Beispiel #4
0
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();
}
Beispiel #5
0
void Cpp2Channel::readEOF(Context* ctx) {
  processReadEOF();
}
Beispiel #6
0
void Cpp2Channel::readEOF() noexcept {
  processReadEOF();
}
Beispiel #7
0
folly::Future<void> Cpp2Channel::close(Context* ctx) {
    DestructorGuard dg(this);
    processReadEOF();
    return ctx->fireClose();
}