Interface.hpp

This File On Github
Ask A Question

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

Interface

"Virtual" Interface provides functionality for accepting "virtual" connections. "virtual" connection is represented by oatpp::network::virtual_::Socket.

namespace oatpp { namespace network { namespace virtual_ { 
  class Interface : public oatpp::base::Countable {}
}}}

Methods

Return Type Name Summary
[none] Interface Constructor.
std::shared_ptr<Interface> createShared Create shared Interface.
std::shared_ptr<ConnectionSubmission> connect Connect to interface.
std::shared_ptr<ConnectionSubmission> connectNonBlocking Connect to interface.
std::shared_ptr<Socket> accept Block and wait for incloming connection.
std::shared_ptr<Socket> acceptNonBlocking Check if incoming connection is available. NonBlocking.
void notifyAcceptors Notify all threads that are waiting on accept().
oatpp::String getName Get interface name.

Interface::Interface

Constructor.

  • @param name - interface name.

Interface(const oatpp::String& name)
  : m_name(name)

Interface::createShared

Create shared Interface.

  • @param name - interface name.
  • @return - std::shared_ptr to Interface.

static std::shared_ptr<Interface> createShared(const oatpp::String& name)

Interface::connect

Connect to interface.

std::shared_ptr<ConnectionSubmission> connect()

Interface::connectNonBlocking

Connect to interface.

std::shared_ptr<ConnectionSubmission> connectNonBlocking()

Interface::accept

Block and wait for incloming connection.

std::shared_ptr<Socket> accept(const bool& waitingHandle = true)

Interface::acceptNonBlocking

Check if incoming connection is available. NonBlocking.

std::shared_ptr<Socket> acceptNonBlocking()

Interface::notifyAcceptors

Notify all threads that are waiting on accept(). Those threads that have waitingHandle changed to false will be unblocked.

void notifyAcceptors()

Interface::getName

Get interface name.

oatpp::String getName()

Interface::ConnectionSubmission

"Future" for oatpp::network::virtual_::Socket.

namespace oatpp { namespace network { namespace virtual_ { 
  class Interface : public oatpp::base::Countable {
    class ConnectionSubmission {}
  };
}}}

Methods

Return Type Name Summary
[none] ConnectionSubmission Constructor.
void setSocket Set socket to be returned in call to Interface::ConnectionSubmission::getSocket()/Interface::ConnectionSubmission::getSocketNonBlocking().
std::shared_ptr<Socket> getSocket Block and wait for socket.
std::shared_ptr<Socket> getSocketNonBlocking Check if socket already available.
bool isValid Check if submission is still valid.

Interface::ConnectionSubmission::ConnectionSubmission

Constructor.

ConnectionSubmission() : m_valid(true)

Interface::ConnectionSubmission::setSocket

Set socket to be returned in call to Interface::ConnectionSubmission::getSocket()/Interface::ConnectionSubmission::getSocketNonBlocking().

void setSocket(const std::shared_ptr<Socket>& socket)

Interface::ConnectionSubmission::getSocket

Block and wait for socket.

std::shared_ptr<Socket> getSocket()

Interface::ConnectionSubmission::getSocketNonBlocking

Check if socket already available. User should repeat call if (!socket isPending()).

std::shared_ptr<Socket> getSocketNonBlocking()

Interface::ConnectionSubmission::isValid

Check if submission is still valid.

  • @return - true if still valid.

bool isValid()