Create a new event type when we successfully accept a connection. This is
distinct from the authorizor verification, which may happen for multiple
racing connection attempts. In contrast, this will only happen on those
that win the race(s). I don't think this is that important for stateless
servers (OSD, MON), but it is important for the MDS to ensure that it keeps
its Session con reference pointing to the most recently-successful
connection attempt.
Signed-off-by: Sage Weil <sage@inktank.com>
*/
virtual void ms_handle_connect(Connection *con) { };
+ /**
+ * Callback indicating we have accepted an incoming connection.
+ *
+ * @param con The (new or existing) Connection associated with the session
+ */
+ virtual void ms_handle_accept(Connection *con) { };
+
/*
* this indicates that the ordered+reliable delivery semantics have
* been violated. Messages may have been lost due to a fault
p++)
(*p)->ms_handle_connect(con);
}
+
+ /**
+ * Notify each Dispatcher of a new incomming Connection. Call
+ * this function whenever a new Connection is accepted.
+ *
+ * @param con Pointer to the new Connection.
+ */
+ void ms_deliver_handle_accept(Connection *con) {
+ for (list<Dispatcher*>::iterator p = dispatchers.begin();
+ p != dispatchers.end();
+ p++)
+ (*p)->ms_handle_accept(con);
+ }
+
/**
* Notify each Dispatcher of a Connection which may have lost
* Messages. Call this function whenever you detect that a lossy Connection