# ConnectionProvider.hpp

This File On Github
Ask A Question

API: latest
module: oatpp-libressl
#include "oatpp-libressl/server/ConnectionProvider.hpp"

# ConnectionProvider

Libressl server connection provider. Extends oatpp::base::Countable, oatpp::network::ServerConnectionProvider.

namespace oatpp { namespace libressl { namespace server { 
  class ConnectionProvider : public oatpp::network::ServerConnectionProvider {}
}}}

# Methods

Return Type Name Summary
[none] ConnectionProvider Constructor.
std::shared_ptr<ConnectionProvider> createShared Multiple implementations:
  1. Create shared ConnectionProvider.
  2. Create shared ConnectionProvider.
[none] ~ConnectionProvider Virtual destructor.
void stop Close all handles.
provider::ResourceHandle<data::stream::IOStream> get Get incoming connection.
oatpp::async::CoroutineStarterForResult<const provider::ResourceHandle<data::stream::IOStream>&> getAsync No need to implement this.

# ConnectionProvider::ConnectionProvider

Constructor.

ConnectionProvider(const std::shared_ptr<Config>& config,
                   const std::shared_ptr<oatpp::network::ServerConnectionProvider>& streamProvider)

# ConnectionProvider::createShared

  1. Create shared ConnectionProvider.
    static std::shared_ptr<ConnectionProvider> createShared(const std::shared_ptr<Config>& config,
                                                            const std::shared_ptr<oatpp::network::ServerConnectionProvider>& streamProvider)
    
  2. Create shared ConnectionProvider.
    static std::shared_ptr<ConnectionProvider> createShared(const std::shared_ptr<Config>& config,
                                                            const network::Address& address,
                                                            bool useExtendedConnections = false)
    

# ConnectionProvider::~ConnectionProvider

Virtual destructor.

~ConnectionProvider()

# ConnectionProvider::stop

Close all handles.

void stop() override

# ConnectionProvider::get

Get incoming connection.

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

# ConnectionProvider::getAsync

No need to implement this.
For Asynchronous IO in oatpp it is considered to be a good practice to accept connections in a seperate thread with the blocking accept() and then process connections in Asynchronous manner with non-blocking read/write.
It may be implemented later

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