void AsyncPipeReader::failRead(const AsyncSocketException& ex) { VLOG(5) << "AsyncPipeReader(this=" << this << ", fd=" << fd_ << "): failed while reading: " << ex.what(); DCHECK(readCallback_ != nullptr); AsyncReader::ReadCallback* callback = readCallback_; readCallback_ = nullptr; callback->readErr(ex); close(); }
void handshakeErr(AsyncSSLSocket* sock, const AsyncSocketException& ex) noexcept override { auto elapsedTime = std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::steady_clock::now() - acceptTime_); VLOG(3) << "SSL handshake error after " << elapsedTime.count() << " ms; " << sock->getRawBytesReceived() << " bytes received & " << sock->getRawBytesWritten() << " bytes sent: " << ex.what(); acceptor_->updateSSLStats(sock, elapsedTime, sslError_); acceptor_->sslConnectionError(); delete this; }
void AcceptorHandshakeHelper::handshakeErr( AsyncSSLSocket* sock, const AsyncSocketException& ex) noexcept { auto elapsedTime = std::chrono::duration_cast<std::chrono::milliseconds>( std::chrono::steady_clock::now() - acceptTime_); VLOG(3) << "SSL handshake error after " << elapsedTime.count() << " ms; " << sock->getRawBytesReceived() << " bytes received & " << sock->getRawBytesWritten() << " bytes sent: " << ex.what(); acceptor_->updateSSLStats(sock, elapsedTime, sslError_); auto sslEx = folly::make_exception_wrapper<SSLException>( sslError_, elapsedTime, sock->getBytesRead()); acceptor_->sslConnectionError(sslEx); destroy(); }
void readErr(const AsyncSocketException& ex) noexcept override { cerr << "client readError: " << ex.what() << endl; }
void writeErr(size_t bytesWritten, const AsyncSocketException& ex) noexcept override { cerr << "client writeError: " << ex.what() << endl; }
void connectErr(const AsyncSocketException& ex) noexcept override { cerr << "AttachDetachClient::connectError: " << ex.what() << endl; sslSocket_.reset(); }
void TcpDuplexConnection::writeErr( size_t bytesWritten, const AsyncSocketException& ex) noexcept { std::cout << "TODO writeErr" << bytesWritten << ex.what() << "\n"; }