Add setter for Servers ConnectionProvider.

We may need synchronization for that.
This commit is contained in:
Benedikt-Alexander Mokroß 2021-09-15 09:13:56 +02:00
parent f1599f2144
commit 462b9c43bf
2 changed files with 20 additions and 0 deletions

View File

@ -163,6 +163,14 @@ v_int32 Server::getStatus() {
return m_status.load();
}
void Server::setConnectionProvider(const std::shared_ptr<ServerConnectionProvider> &connectionProvider) {
m_connectionProvider = connectionProvider;
}
void Server::setConnectionHandler(const std::shared_ptr<ConnectionHandler> &connectionHandler) {
m_connectionHandler = connectionHandler;
}
Server::~Server() {
stop();
}

View File

@ -154,6 +154,18 @@ public:
* </ul>
*/
v_int32 getStatus();
/**
* Replaces the internal connection-provider
* @param connectionProvider - &id:oatpp::network::ConnectionProvider;.
*/
void setConnectionProvider(const std::shared_ptr<ServerConnectionProvider>& connectionProvider);
/**
* Replaces the internal connection-handler
* @param connectionHandler - &id:oatpp::network::ConnectionHandler;.
*/
void setConnectionHandler(const std::shared_ptr<ConnectionHandler>& connectionHandler);
};