libpalliate v0.0.1
Palliate core library
transport::TCP::Server Class Reference

#include <server.h>

Inheritance diagram for transport::TCP::Server:

Public Member Functions

 Server (const char *_host, unsigned _port, bool _packed=false)
 
bool loop () override
 
- Public Member Functions inherited from transport::Server
 ~Server () override=default
 
 Server (std::string const &_name, bool _packed=false)
 
virtual builder_t prepare ()
 
void broadcast (capnp::MessageBuilder *message)
 
void set_event (std::function< void(Client *, reader_t)> message_event)
 
void add (std::unique_ptr< Client > clientobj)
 
void remove (Client *obj)
 
- Public Member Functions inherited from runnable
 runnable (std::string const &_name)
 
virtual ~runnable ()
 
virtual void operator() (std::stop_token token={})
 
void run ()
 
void run (callback_f _callback)
 
void stop ()
 
auto operator<=> (runnable const &other) const
 

Additional Inherited Members

- Public Types inherited from runnable
using callback_f = std::function< void()>
 
using callback_t = std::stop_callback< callback_f >
 
- Protected Member Functions inherited from runnable
virtual bool setup ()
 
virtual bool loop ()=0
 
- Protected Attributes inherited from transport::Server
std::list< std::unique_ptr< Client > > clients
 
std::mutex clients_mutex
 
bool packed
 
std::function< void(Client *, reader_t)> message_event
 
- Protected Attributes inherited from runnable
std::jthread thread
 
std::unique_ptr< callback_tcallback
 

Constructor & Destructor Documentation

◆ Server()

Server::Server ( const char *  _host,
unsigned  _port,
bool  _packed = false 
)

Member Function Documentation

◆ loop()

bool Server::loop ( )
overridevirtual

Implements runnable.


The documentation for this class was generated from the following files: