libcluon  0.0.148
cluon::TCPServer Class Reference

#include <TCPServer.hpp>

Public Member Functions

 TCPServer (uint16_t port, std::function< void(std::string &&from, std::shared_ptr< cluon::TCPConnection > connection)> newConnectionDelegate) noexcept
 
 ~TCPServer () noexcept
 
bool isRunning () const noexcept
 

Constructor & Destructor Documentation

◆ TCPServer()

cluon::TCPServer::TCPServer ( uint16_t  port,
std::function< void(std::string &&from, std::shared_ptr< cluon::TCPConnection > connection)>  newConnectionDelegate 
)
noexcept

Constructor to create a TCP server.

Parameters
portPort to receive UDP packets from.
newConnectionDelegateFunctional to handle incoming TCP connections.

References retVal.

◆ ~TCPServer()

cluon::TCPServer::~TCPServer ( )
noexcept

Member Function Documentation

◆ isRunning()

bool cluon::TCPServer::isRunning ( ) const
noexcept
Returns
true if the TCPServer could successfully be created and is able to receive data.

References cluon::TerminateHandler::instance(), and cluon::TerminateHandler::isTerminated.