IEventListener* listener = listener_;
listener_ = nullptr;
- listener->OnRejected(appid);
+ listener->OnRejected(appid, RPC_PORT_ERROR_PERMISSION_DENIED);
}
void Proxy::OnPortAppeared(const std::string& appid,
IEventListener* listener = listener_;
listener_ = nullptr;
if (r == -EILLEGALACCESS)
- listener->OnRejected(appid);
+ listener->OnRejected(appid, RPC_PORT_ERROR_PERMISSION_DENIED);
else
listener->OnDisconnected(appid);
return;
IEventListener* listener = obj->listener_;
obj->listener_ = nullptr;
obj->fd_broker_.Cancel();
- listener->OnRejected(obj->target_appid_);
+ listener->OnRejected(obj->target_appid_, RPC_PORT_ERROR_IO_ERROR);
}
return G_SOURCE_REMOVE;
public:
virtual void OnConnected(const std::string& endpoint, Port* port) = 0;
virtual void OnDisconnected(const std::string& endpoint) = 0;
- virtual void OnRejected(const std::string& endpoint) = 0;
+ virtual void OnRejected(const std::string& endpoint, int err_code) = 0;
virtual void OnReceived(const std::string& endpoint) = 0;
};
}
}
- void OnRejected(const std::string& endpoint) override {
+ void OnRejected(const std::string& endpoint, int err_code) override {
for (auto& ev : rejected_events_) {
+ set_last_result(err_code);
ev->cb_(endpoint.c_str(), GetPortName().c_str(), ev->user_data_);
}
}