Connection.hpp

This File On Github
Ask A Question

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

Connection

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

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

Methods

Return Type Name Summary
[none] Connection Constructor.
std::shared_ptr<Connection> createShared Create shared Connection.
[none] ~Connection Virtual Destructor (See oatpp::base::Countable).
data::v_io_size write Implementation of oatpp::data::stream::IOStream::write.
data::v_io_size read Implementation of oatpp::data::stream::IOStream::read.
void close Close socket handle.
data::v_io_handle getHandle Get socket handle.

Connection::Connection

Constructor.

Connection(data::v_io_handle handle)

Connection::createShared

Create shared Connection.

static std::shared_ptr<Connection> createShared(data::v_io_handle handle)

Connection::~Connection

Virtual Destructor (See oatpp::base::Countable). Close socket handle.

~Connection()

Connection::write

Implementation of oatpp::data::stream::IOStream::write.

  • @param buff - buffer containing data to write.
  • @param count - bytes count you want to write.
  • @return - actual amount of bytes written. See oatpp::data::v_io_size.

data::v_io_size write(const void *buff, data::v_io_size count) override

Connection::read

Implementation of oatpp::data::stream::IOStream::read.

  • @param buff - buffer to read data to.
  • @param count - buffer size.
  • @return - actual amount of bytes read. See oatpp::data::v_io_size.

data::v_io_size read(void *buff, data::v_io_size count) override

Connection::close

Close socket handle.

void close()

Connection::getHandle

Get socket handle.

data::v_io_handle getHandle()