mirror of
https://github.com/ceph/ceph
synced 2025-03-11 02:39:05 +00:00
msgr: add get_loopback_connection() method
Return the Connection* for ourselves, so we can queue messages for ourselves. Signed-off-by: Sage Weil <sage@inktank.com>
This commit is contained in:
parent
a6ed62e324
commit
a7059eb3f3
@ -439,6 +439,10 @@ public:
|
||||
* @param dest The entity to get a connection for.
|
||||
*/
|
||||
virtual Connection *get_connection(const entity_inst_t& dest) = 0;
|
||||
/**
|
||||
* Get the Connection object associated with ourselves.
|
||||
*/
|
||||
virtual Connection *get_loopback_connection() = 0;
|
||||
/**
|
||||
* Send a "keepalive" ping to the given dest, if it has a working Connection.
|
||||
* If the Messenger doesn't already have a Connection, or if the underlying
|
||||
|
@ -380,6 +380,10 @@ Connection *SimpleMessenger::get_connection(const entity_inst_t& dest)
|
||||
}
|
||||
}
|
||||
|
||||
Connection *SimpleMessenger::get_loopback_connection()
|
||||
{
|
||||
return (Connection*)local_connection->get();
|
||||
}
|
||||
|
||||
void SimpleMessenger::submit_message(Message *m, Connection *con,
|
||||
const entity_addr_t& dest_addr, int dest_type, bool lazy)
|
||||
|
@ -294,6 +294,7 @@ public:
|
||||
* @return The requested Connection, as a pointer whose reference you own.
|
||||
*/
|
||||
virtual Connection *get_connection(const entity_inst_t& dest);
|
||||
virtual Connection *get_loopback_connection();
|
||||
/**
|
||||
* Send a "keepalive" ping to the given dest, if it has a working Connection.
|
||||
* If the Messenger doesn't already have a Connection, or if the underlying
|
||||
|
Loading…
Reference in New Issue
Block a user