set_peer_id(name.num());
}
- protected:
- uint64_t features = 0;
-
- public:
- void set_features(uint64_t new_features) {
- features = new_features;
- }
- auto get_features() const {
- return features;
- }
- bool has_feature(uint64_t f) const {
- return features & f;
- }
-
public:
Connection() {}
virtual ~Connection() {}
bool peer_is_osd() const { return peer_name.is_osd(); }
bool peer_is_client() const { return peer_name.is_client(); }
+ virtual uint64_t get_features() const = 0;
+
+ bool has_feature(uint64_t f) const {
+ return get_features() & f;
+ }
+
/// true if the handshake has completed and no errors have been encountered
virtual bool is_connected() const = 0;
SocketMessenger& messenger;
std::unique_ptr<Protocol> protocol;
+ uint64_t features = 0;
+
ceph::net::Policy<crimson::common::Throttle> policy;
/// the seq num of the last transmitted message
ChainedDispatchers& dispatchers);
~SocketConnection() override;
+ uint64_t get_features() const override {
+ return features;
+ }
+
bool is_connected() const override;
#ifdef UNIT_TESTS_BUILT
void print(std::ostream& out) const override;
+ void set_features(uint64_t f) {
+ features = f;
+ }
+
/// start a handshake from the client's perspective,
/// only call when SocketConnection first construct
void start_connect(const entity_addr_t& peer_addr,