# 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:
|
[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.
- @param config - oatpp::libressl::Config.
- @param streamProvider - provider of underlying transport stream. oatpp::network::ServerConnectionProvider.
ConnectionProvider(const std::shared_ptr<Config>& config,
const std::shared_ptr<oatpp::network::ServerConnectionProvider>& streamProvider)
# ConnectionProvider::createShared
- Create shared ConnectionProvider.
- @param config - oatpp::libressl::Config.
- @param streamProvider - provider of underlying transport stream. oatpp::network::ServerConnectionProvider.
- @return -
std::shared_ptr
to ConnectionProvider.
static std::shared_ptr<ConnectionProvider> createShared(const std::shared_ptr<Config>& config, const std::shared_ptr<oatpp::network::ServerConnectionProvider>& streamProvider)
- Create shared ConnectionProvider.
- @param config - oatpp::libressl::Config.
- @param address - oatpp::network::Address.
- @param useExtendedConnections - set
true
to use ConnectionProvider::ExtendedConnection.false
to use oatpp::network::tcp::Connection. - @return -
std::shared_ptr
to 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.
- @return oatpp::data::stream::IOStream.
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