SimpleTCPConnectionProvider.hpp

This File On Github
Ask A Question

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

SimpleTCPConnectionProvider

Simple provider of clinet TCP connections.

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

Methods

Return Type Name Summary
[none] SimpleTCPConnectionProvider Constructor.
std::shared_ptr<SimpleTCPConnectionProvider> createShared Create shared client SimpleTCPConnectionProvider.
void close Implements oatpp::network::ConnectionProvider::close(). Here does nothing.
std::shared_ptr<IOStream> getConnection Get connection.
oatpp::async::CoroutineStarterForResult<const std::shared_ptr<oatpp::data::stream::IOStream>&> getConnectionAsync Get connection in asynchronous manner.
oatpp::String getHost Get host name.
v_word16 getPort Get port.

SimpleTCPConnectionProvider::SimpleTCPConnectionProvider

Constructor.

  • @param host - host name without schema and port. Ex.: "oatpp.io", "127.0.0.1", "localhost".
  • @param port - server port.

SimpleTCPConnectionProvider(const oatpp::String& host, v_word16 port)

SimpleTCPConnectionProvider::createShared

Create shared client SimpleTCPConnectionProvider.

  • @param host - host name without schema and port. Ex.: "oatpp.io", "127.0.0.1", "localhost".
  • @param port - server port.
  • @return - std::shared_ptr to SimpleTCPConnectionProvider.

static std::shared_ptr<SimpleTCPConnectionProvider> createShared(const oatpp::String& host, v_word16 port)

SimpleTCPConnectionProvider::close

Implements oatpp::network::ConnectionProvider::close(). Here does nothing.

void close() override

SimpleTCPConnectionProvider::getConnection

Get connection.

std::shared_ptr<IOStream> getConnection() override

SimpleTCPConnectionProvider::getConnectionAsync

Get connection in asynchronous manner.

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

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

SimpleTCPConnectionProvider::getHost

Get host name.

  • @return - host name.

oatpp::String getHost()

SimpleTCPConnectionProvider::getPort

Get port.

  • @return - port.

v_word16 getPort()