#include <TcpHelperClasses.h>
|
void | setPortReuse (bool reuse) |
|
bool | start () |
|
void | close () |
|
bool | isReady () const |
|
bool | reConnect (std::chrono::milliseconds timeOut) |
|
void | setDataCall (std::function< size_t(TcpConnection::pointer, const char *, size_t)> dataFunc) |
|
void | setErrorCall (std::function< bool(TcpConnection::pointer, const std::error_code &)> errorFunc) |
|
void | handle_accept (TcpAcceptor::pointer acc, TcpConnection::pointer new_connection) |
|
TcpConnection::pointer | findSocket (int connectorID) const |
|
|
static pointer | create (asio::io_context &io_context, const std::string &address, const std::string &port, bool reuse_port=false, int nominalBufferSize=10192) |
|
static pointer | create (asio::io_context &io_context, const std::string &address, uint16_t PortNum, bool reuse_port=false, int nominalBufferSize=10192) |
|
static pointer | create (asio::io_context &io_context, uint16_t PortNum, int nominalBufferSize=10192) |
|
helper class for a server
◆ close()
void helics::tcp::TcpServer::close |
( |
| ) |
|
◆ findSocket()
TcpConnection::pointer helics::tcp::TcpServer::findSocket |
( |
int |
connectorID | ) |
const |
get a socket by it identification code
◆ isReady()
bool helics::tcp::TcpServer::isReady |
( |
| ) |
const |
|
inline |
check if the server is ready to start
◆ reConnect()
bool helics::tcp::TcpServer::reConnect |
( |
std::chrono::milliseconds |
timeOut | ) |
|
reConnect the server with the same address
Referenced by start().
◆ setDataCall()
void helics::tcp::TcpServer::setDataCall |
( |
std::function< size_t(TcpConnection::pointer, const char *, size_t)> |
dataFunc | ) |
|
|
inline |
◆ setErrorCall()
void helics::tcp::TcpServer::setErrorCall |
( |
std::function< bool(TcpConnection::pointer, const std::error_code &)> |
errorFunc | ) |
|
|
inline |
set the error path callback
◆ setPortReuse()
void helics::tcp::TcpServer::setPortReuse |
( |
bool |
reuse | ) |
|
|
inline |
◆ start()
bool helics::tcp::TcpServer::start |
( |
| ) |
|
start accepting new connections
- Returns
- true if the start up was successful
References reConnect().
The documentation for this class was generated from the following files: