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 close Implementation of oatpp::network::ClientConnection::Close method.
std::shared_ptr<IOStream> getConnection Get connection.
oatpp::async::CoroutineStarterForResult<const std::shared_ptr<oatpp::data::stream::IOStream>&> getConnectionAsync Get connection in asynchronous manner.

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(data::v_io_size maxToRead, data::v_io_size maxToWrite)

ConnectionProvider::close

Implementation of oatpp::network::ClientConnection::Close method.

void close() override

ConnectionProvider::getConnection

Get connection.

std::shared_ptr<IOStream> getConnection() override

ConnectionProvider::getConnectionAsync

Get connection in asynchronous manner.

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

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