There's no need to return a futurized bool from is_connected() if we are
holding ConnectionRef from the same core. Also add the missing const
qualifier.
Signed-off-by: Yingxin Cheng <yingxin.cheng@intel.com>
bool peer_is_client() const { return peer_name.is_client(); }
/// true if the handshake has completed and no errors have been encountered
- virtual seastar::future<bool> is_connected() = 0;
+ virtual bool is_connected() const = 0;
/// send a message over a connection that has completed its handshake
virtual seastar::future<> send(MessageRef msg) = 0;
return &messenger;
}
-seastar::future<bool> SocketConnection::is_connected()
+bool SocketConnection::is_connected() const
{
- return seastar::smp::submit_to(shard_id(), [this] {
- return protocol->is_connected();
- });
+ ceph_assert(seastar::engine().cpu_id() == shard_id());
+ return protocol->is_connected();
}
seastar::future<> SocketConnection::send(MessageRef msg)
Messenger* get_messenger() const override;
- seastar::future<bool> is_connected() override;
+ bool is_connected() const override;
seastar::future<> send(MessageRef msg) override;