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::base::Countable, public oatpp::network::ServerConnectionProvider {}
}}}

Methods

Return Type Name Summary
[none] ConnectionProvider Constructor.
std::shared_ptr<ConnectionProvider> createShared Create shared ConnectionProvider.
[none] ~ConnectionProvider Virtual destructor.
void close Close all handles.
std::shared_ptr<IOStream> getConnection Get incoming connection.
oatpp::async::CoroutineStarterForResult<const std::shared_ptr<oatpp::data::stream::IOStream>&> getConnectionAsync No need to implement this.

ConnectionProvider::ConnectionProvider

Constructor.

ConnectionProvider(const std::shared_ptr<Config>& config, v_word16 port, bool nonBlocking = false)

ConnectionProvider::createShared

Create shared ConnectionProvider.

static std::shared_ptr<ConnectionProvider> createShared(const std::shared_ptr<Config>& config,
                                                        v_word16 port,
                                                        bool nonBlocking = false)

ConnectionProvider::~ConnectionProvider

Virtual destructor.

~ConnectionProvider()

ConnectionProvider::close

Close all handles.

void close() override

ConnectionProvider::getConnection

Get incoming connection.

std::shared_ptr<IOStream> getConnection() override

ConnectionProvider::getConnectionAsync

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 std::shared_ptr<oatpp::data::stream::IOStream>&> getConnectionAsync() override