# ConnectionProviderSwitch.hpp
This File On Github
Ask A Question
API: latest
module: oatpp
#include "oatpp/network/ConnectionProviderSwitch.hpp"
# ConnectionProviderSwitch
ConnectionProviderSwitch can be used to hot-change connection providers. Ex.: to hot-reload server certificate.
namespace oatpp { namespace network {
class ConnectionProviderSwitch : public ServerConnectionProvider, public ClientConnectionProvider {}
}}
# Methods
Return Type | Name | Summary |
---|---|---|
[none] | ConnectionProviderSwitch | Multiple implementations:
|
void | resetProvider | Reset current provider. |
provider::ResourceHandle<data::stream::IOStream> | get | Get new connection. |
oatpp::async::CoroutineStarterForResult<const provider::ResourceHandle<data::stream::IOStream>&> | getAsync | Get new connection. |
void | stop | Stop current provider. |
# ConnectionProviderSwitch::ConnectionProviderSwitch
- Default constructor.
ConnectionProviderSwitch() = default
- Constructor.
- @param provider
ConnectionProviderSwitch(const std::shared_ptr<ConnectionProvider>& provider)
# ConnectionProviderSwitch::resetProvider
Reset current provider.
- @param provider
void resetProvider(const std::shared_ptr<ConnectionProvider>& provider)
# ConnectionProviderSwitch::get
Get new connection.
- @return oatpp::data::stream::IOStream.
provider::ResourceHandle<data::stream::IOStream> get() override
# ConnectionProviderSwitch::getAsync
Get new connection.
- @return oatpp::data::stream::IOStream.
oatpp::async::CoroutineStarterForResult<const provider::ResourceHandle<data::stream::IOStream>&> getAsync() override
# ConnectionProviderSwitch::stop
Stop current provider.
void stop() override