+shared_ptr<rpcc> rpcc::bind_cached(const string & destination) {
+ auto client = global->get_handle(destination);
+ lock cl = lock(client->bind_m_);
+ if (!client->bind_done_) {
+ LOG_NONMEMBER << "bind(\"" << destination << "\")";
+ int ret = client->bind(1000ms);
+ if (ret < 0) {
+ LOG_NONMEMBER << "bind failure! " << destination << " " << ret;
+ client.reset();
+ } else {
+ LOG_NONMEMBER << "bind succeeded " << destination;
+ }
+ }
+ return client;
+}
+
+void rpcc::unbind_cached(const string & destination) {
+ global->erase_handle(destination);
+}
+