# Connection.hpp

This File On Github
Ask A Question

API: latest
module: oatpp-libressl
#include "oatpp-libressl/Connection.hpp"

# Connection

TLS Connection implementation. Extends oatpp::base::Countable and oatpp::data::stream::IOStream.

namespace oatpp { namespace libressl { 
  class Connection : public oatpp::base::Countable, public oatpp::data::stream::IOStream {}
}}

# Methods

Return Type Name Summary
[none] Connection Constructor.
[none] ~Connection Virtual destructor.
v_io_size write Write operation callback.
oatpp::v_io_size read Read operation callback.
void setOutputStreamIOMode Set OutputStream I/O mode.
oatpp::data::stream::IOMode getOutputStreamIOMode Set OutputStream I/O mode.
oatpp::data::stream::Context& getOutputStreamContext Get output stream context.
void setInputStreamIOMode Set InputStream I/O mode.
oatpp::data::stream::IOMode getInputStreamIOMode Get InputStream I/O mode.
oatpp::data::stream::Context& getInputStreamContext Get input stream context.
void closeTLS Close TLS handles.
std::shared_ptr<data::stream::IOStream> getTransportStream Get the underlying transport stream.
TLSHandle getTlsHandle Get TLS handle.

# Connection::Connection

Constructor.

Connection(const std::shared_ptr<TLSObject>& tlsObject,
           const std::shared_ptr<oatpp::data::stream::IOStream>& stream)

# Connection::~Connection

Virtual destructor.

~Connection()

# Connection::write

Write operation callback.

  • @param data - pointer to data.
  • @param count - size of the data in bytes.
  • @param action - async specific action. If action is NOT oatpp::async::Action::TYPE_NONE, then caller MUST return this action on coroutine iteration.
  • @return - actual number of bytes written. 0 - to indicate end-of-file.

v_io_size write(const void *data, v_buff_size count, async::Action& action) override

# Connection::read

Read operation callback.

  • @param buffer - pointer to buffer.
  • @param count - size of the buffer in bytes.
  • @param action - async specific action. If action is NOT oatpp::async::Action::TYPE_NONE, then caller MUST return this action on coroutine iteration.
  • @return - actual number of bytes written to buffer. 0 - to indicate end-of-file.

oatpp::v_io_size read(void *buff, v_buff_size count, async::Action& action) override

# Connection::setOutputStreamIOMode

Set OutputStream I/O mode.

  • @param ioMode

void setOutputStreamIOMode(oatpp::data::stream::IOMode ioMode) override

# Connection::getOutputStreamIOMode

Set OutputStream I/O mode.

  • @return

oatpp::data::stream::IOMode getOutputStreamIOMode() override

# Connection::getOutputStreamContext

Get output stream context.

oatpp::data::stream::Context& getOutputStreamContext() override

# Connection::setInputStreamIOMode

Set InputStream I/O mode.

  • @param ioMode

void setInputStreamIOMode(oatpp::data::stream::IOMode ioMode) override

# Connection::getInputStreamIOMode

Get InputStream I/O mode.

  • @return

oatpp::data::stream::IOMode getInputStreamIOMode() override

# Connection::getInputStreamContext

Get input stream context.

oatpp::data::stream::Context& getInputStreamContext() override

# Connection::closeTLS

Close TLS handles.

void closeTLS()

# Connection::getTransportStream

Get the underlying transport stream.

  • @return

std::shared_ptr<data::stream::IOStream> getTransportStream()

# Connection::getTlsHandle

Get TLS handle.

  • @return - tls*.

TLSHandle getTlsHandle()