# ConnectionProvider.hpp

This File On Github
Ask A Question

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

# ConnectionProvider

Provider of "virtual" connections for client. See oatpp::network::virtual_::Interface, oatpp::network::virtual_::Socket
Extends oatpp::network::ClientConnectionProvider.

namespace oatpp { namespace network { namespace virtual_ { namespace client { 
  class ConnectionProvider : public oatpp::network::ClientConnectionProvider {}
}}}}

# Methods

Return Type Name Summary
[none] ConnectionProvider Constructor.
std::shared_ptr<ConnectionProvider> createShared Create shared ConnectionProvider.
void setSocketMaxAvailableToReadWrtie Limit the available amount of bytes to read from socket and limit the available amount of bytes to write to socket.
void stop Implementation of oatpp::provider::Provider::Stop method.
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 Does nothing.

# ConnectionProvider::ConnectionProvider

Constructor.

ConnectionProvider(const std::shared_ptr<virtual_::Interface>& interface)

# ConnectionProvider::createShared

Create shared ConnectionProvider.

static std::shared_ptr<ConnectionProvider> createShared(const std::shared_ptr<virtual_::Interface>& interface)

# ConnectionProvider::setSocketMaxAvailableToReadWrtie

Limit the available amount of bytes to read from socket and limit the available amount of bytes to write to socket.
This method is used for testing purposes only.

  • @param maxToRead - maximum available amount of bytes to read.
  • @param maxToWrite - maximum available amount of bytes to write.

void setSocketMaxAvailableToReadWrtie(v_io_size maxToRead, v_io_size maxToWrite)

# ConnectionProvider::stop

Implementation of oatpp::provider::Provider::Stop method.

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

Does nothing.

  • @param connection

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