OpenDaVINCI  4.16.0
odcore::io::ConnectionAcceptor Class Referenceabstract

#include <ConnectionAcceptor.h>

Inheritance diagram for odcore::io::ConnectionAcceptor:
Inheritance graph

Public Member Functions

 ConnectionAcceptor (const uint32_t &port)
 
virtual ~ConnectionAcceptor ()
 
void setConnectionAcceptorListener (ConnectionAcceptorListener *listener)
 
void start ()
 
void stop ()
 
virtual void onNewConnection (std::shared_ptr< odcore::io::tcp::TCPConnection > connection)=0
 

Protected Member Functions

void onNewConnection (std::shared_ptr< odcore::io::tcp::TCPConnection > connection)
 

Protected Attributes

base::Mutex m_listenerMutex
 
ConnectionAcceptorListenerm_listener
 
std::shared_ptr
< odcore::io::tcp::TCPAcceptor
m_acceptor
 

Detailed Description

This class is used to accept incoming connection. The For every new Connection, the ConnectionAcceptorListener is invoked with a new Connection object.

To establish a connection, see #Connection

Constructor & Destructor Documentation

odcore::io::ConnectionAcceptor::ConnectionAcceptor ( const uint32_t &  port)
odcore::io::ConnectionAcceptor::~ConnectionAcceptor ( )
virtual

References m_acceptor.

Member Function Documentation

virtual void odcore::io::tcp::TCPAcceptorListener::onNewConnection ( std::shared_ptr< odcore::io::tcp::TCPConnection connection)
pure virtualinherited

This interface is invoked on newly accepted connections.

Parameters
connectionNewly established connection.

Referenced by odcore::wrapper::POSIX::POSIXTCPAcceptor::invokeAcceptorListener(), and odcore::wrapper::WIN32Impl::WIN32TCPAcceptor::invokeAcceptorListener().

void odcore::io::ConnectionAcceptor::onNewConnection ( std::shared_ptr< odcore::io::tcp::TCPConnection connection)
protected
void odcore::io::ConnectionAcceptor::setConnectionAcceptorListener ( ConnectionAcceptorListener listener)

References m_listener, and m_listenerMutex.

void odcore::io::ConnectionAcceptor::start ( )

References m_acceptor.

void odcore::io::ConnectionAcceptor::stop ( )

References m_acceptor.

Member Data Documentation

std::shared_ptr<odcore::io::tcp::TCPAcceptor> odcore::io::ConnectionAcceptor::m_acceptor
protected
ConnectionAcceptorListener* odcore::io::ConnectionAcceptor::m_listener
protected
base::Mutex odcore::io::ConnectionAcceptor::m_listenerMutex
protected