mirror of
https://github.com/scylladb/scylladb.git
synced 2026-05-01 21:55:50 +00:00
net: add has_per_core_namespace() attribute to network stack
POSIX stack does not allow one to bind more than one socket to given port. Native stack on the other hand does. The way services are set up depends on that. For instance, on native stack one might want to start the service on all cores, but on POSIX stack only on one of them.
This commit is contained in:
committed by
Avi Kivity
parent
b647bb5746
commit
95e09be799
@@ -194,6 +194,7 @@ public:
|
||||
virtual future<> initialize() {
|
||||
return make_ready_future();
|
||||
}
|
||||
virtual bool has_per_core_namespace() = 0;
|
||||
};
|
||||
|
||||
class network_stack_registry {
|
||||
|
||||
@@ -45,6 +45,7 @@ public:
|
||||
static std::unique_ptr<network_stack> create(boost::program_options::variables_map opts) {
|
||||
return std::make_unique<native_network_stack>(opts);
|
||||
}
|
||||
virtual bool has_per_core_namespace() override { return true; };
|
||||
friend class native_server_socket_impl<tcp4>;
|
||||
};
|
||||
|
||||
|
||||
@@ -68,6 +68,7 @@ public:
|
||||
static std::unique_ptr<network_stack> create(boost::program_options::variables_map opts) {
|
||||
return std::unique_ptr<network_stack>(new posix_network_stack(opts));
|
||||
}
|
||||
virtual bool has_per_core_namespace() override { return false; };
|
||||
};
|
||||
|
||||
class posix_ap_network_stack : public posix_network_stack {
|
||||
|
||||
Reference in New Issue
Block a user