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

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