# ConnectionProvider.hpp

This File On Github
Ask A Question

API: latest
module: oatpp
#include "oatpp/network/tcp/client/ConnectionProvider.hpp"

# ConnectionProvider

Simple provider of clinet TCP connections.

namespace oatpp { namespace network { namespace tcp { namespace client { 
  class ConnectionProvider : public base::Countable, public ClientConnectionProvider {}
}}}}

# Methods

Return Type Name Summary
[none] ConnectionProvider Constructor.
std::shared_ptr<ConnectionProvider> createShared Create shared client ConnectionProvider.
void stop Implements oatpp::provider::Provider::stop(). Here does nothing.
std::shared_ptr<data::stream::IOStream> get Get connection.
oatpp::async::CoroutineStarterForResult<const std::shared_ptr<data::stream::IOStream>&> getAsync Get connection in asynchronous manner.
void invalidate Call shutdown read and write on an underlying file descriptor.
const network::Address& getAddress Get address - oatpp::network::Address.

# ConnectionProvider::ConnectionProvider

Constructor.

ConnectionProvider(const network::Address& address)

# ConnectionProvider::createShared

Create shared client ConnectionProvider.

static std::shared_ptr<ConnectionProvider> createShared(const network::Address& address)

# ConnectionProvider::stop

Implements oatpp::provider::Provider::stop(). Here does nothing.

void stop() override

# ConnectionProvider::get

Get connection.

std::shared_ptr<data::stream::IOStream> get() override

# ConnectionProvider::getAsync

Get connection in asynchronous manner.

  • @return - oatpp::async::CoroutineStarterForResult.

oatpp::async::CoroutineStarterForResult<const std::shared_ptr<data::stream::IOStream>&> getAsync() override

# ConnectionProvider::invalidate

Call shutdown read and write on an underlying file descriptor. connection MUST be an object previously obtained from THIS connection provider.

  • @param connection

void invalidate(const std::shared_ptr<data::stream::IOStream>& connection) override

# ConnectionProvider::getAddress

Get address - oatpp::network::Address.

  • @return

const network::Address& getAddress() const