Return the addr that is actually being used for this socket (among the
potentially many in the addrvec).
Signed-off-by: Sage Weil <sage@redhat.com>
bool peer_is_osd() const { return peer_type == CEPH_ENTITY_TYPE_OSD; }
bool peer_is_client() const { return peer_type == CEPH_ENTITY_TYPE_CLIENT; }
+ /// which of the peer's addrs is actually in use for this connection
+ virtual entity_addr_t get_peer_socket_addr() const = 0;
+
entity_addr_t get_peer_addr() const {
return peer_addrs.front();
}
std::lock_guard<std::mutex> l(lock);
policy.lossy = true;
}
+ entity_addr_t get_peer_socket_addr() const override {
+ return target_addr;
+ }
private:
enum {
void mark_down() override;
void mark_disposable() override;
+ entity_addr_t get_peer_socket_addr() const override {
+ return peer_addrs.front();
+ }
+
}; /* PipeConnection */
typedef boost::intrusive_ptr<PipeConnection> PipeConnectionRef;