}
SocketConnection::SocketConnection(SocketMessenger& messenger,
- Dispatcher& dispatcher)
+ Dispatcher& dispatcher,
+ bool is_msgr2)
: messenger(messenger)
{
ceph_assert(&messenger.container().local() == &messenger);
- protocol = std::make_unique<ProtocolV1>(dispatcher, *this, messenger);
+ if (is_msgr2) {
+ // TODO: ProtocolV2
+ ceph_assert(false);
+ } else {
+ protocol = std::make_unique<ProtocolV1>(dispatcher, *this, messenger);
+ }
}
SocketConnection::~SocketConnection() {}
public:
SocketConnection(SocketMessenger& messenger,
- Dispatcher& dispatcher);
+ Dispatcher& dispatcher,
+ bool is_msgr2);
~SocketConnection() override;
Messenger* get_messenger() const override;
#warning fixme
// we currently do dangerous i/o from a Connection core, different from the Socket core.
container().invoke_on(shard, [sock = std::move(socket), peer_addr, this](auto& msgr) mutable {
- SocketConnectionRef conn = seastar::make_shared<SocketConnection>(msgr, *msgr.dispatcher);
+ SocketConnectionRef conn = seastar::make_shared<SocketConnection>(msgr, *msgr.dispatcher, false);
conn->start_accept(std::move(sock), peer_addr);
});
});
if (auto found = lookup_conn(peer_addr); found) {
return seastar::make_foreign(found->shared_from_this());
}
- SocketConnectionRef conn = seastar::make_shared<SocketConnection>(*this, *dispatcher);
+ SocketConnectionRef conn = seastar::make_shared<SocketConnection>(*this, *dispatcher, false);
conn->start_connect(peer_addr, peer_type);
return seastar::make_foreign(conn->shared_from_this());
}