# 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:
  1. Default constructor.
  2. Constructor.
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

  1. Default constructor.
    ConnectionProviderSwitch() = default
    
  2. 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.

provider::ResourceHandle<data::stream::IOStream> get() override

# ConnectionProviderSwitch::getAsync

Get new connection.

oatpp::async::CoroutineStarterForResult<const provider::ResourceHandle<data::stream::IOStream>&> getAsync() override

# ConnectionProviderSwitch::stop

Stop current provider.

void stop() override