# 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. |
provider::ResourceHandle<data::stream::IOStream> | get | Get connection. |
oatpp::async::CoroutineStarterForResult<const provider::ResourceHandle<data::stream::IOStream>&> | getAsync | Get connection in asynchronous manner. |
# ConnectionProvider::ConnectionProvider
Constructor.
- @param interface - oatpp::network::virtual_::Interface.
ConnectionProvider(const std::shared_ptr<virtual_::Interface>& _interface)
# ConnectionProvider::createShared
Create shared ConnectionProvider.
- @param interface - oatpp::network::virtual_::Interface.
- @return -
std::shared_ptr
to 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.
- @return -
std::shared_ptr
to oatpp::data::stream::IOStream.
provider::ResourceHandle<data::stream::IOStream> get() override
# ConnectionProvider::getAsync
Get connection in asynchronous manner.
- @return - oatpp::async::CoroutineStarterForResult.
oatpp::async::CoroutineStarterForResult<const provider::ResourceHandle<data::stream::IOStream>&> getAsync() override