void ServerUnaryCallData::abort(int error_code, const QString& error_message) { if (status_ != Status::FROZEN) { qWarning() << "Resume called for non-frozen call data."; Q_ASSERT(false); return; } status_ = Status::DONE; grpc::Status error_status(static_cast<grpc::StatusCode>(error_code), error_message.toStdString()); writer_.FinishWithError(error_status, this); }
void async_serial::close() { if(!is_open()) return; _open=false; _io.post(boost::bind(&async_serial::_do_close, this)); _background_thread.join(); _io.reset(); if(error_status()) throw(boost::system::system_error(boost::system::error_code(), "Error while closing the device")); }