$darkmode
#include <server.hpp>
Public Member Functions | |
| Server (const std::string &addr, int port) | |
| ~Server () | |
| void | set_threads (int n) |
| void | set_address (const std::string &addr) |
| void | set_port (int port) |
| bool | is_listening () const |
| void | listen () |
| cloe::Json | endpoints_to_json (const std::vector< std::string > &endpoints) const |
| void | stop () |
| std::vector< std::string > | endpoints () const |
Protected Member Functions | |
| void | add_handler (const std::string &key, Handler h) |
Protected Attributes | |
| friend | StaticRegistrar |
| friend | LockedRegistrar |
| friend | BufferRegistrar |
A Server accepts and serves endpoints for Handlers.
This is a convenience wrapper around ServerImpl.
|
inline |
When a Server goes out of scope, it will stop listening for you if you haven't done so already.
|
inlineprotected |
Add a handler with the route muxer in the internal handler routine.
|
inline |
Return a list of all registered endpoints.
|
inline |
Return endpoint data in json format.
|
inline |
Returns whether the server has started and is currently listening.
| void oak::Server::listen | ( | ) |
Start the server.
|
inline |
Set the address on which the server will listen.
|
inline |
Set the port on which to listen.
|
inline |
Set the number of threads used for listening to connections. This is the number of requests that can be handled simultaneously.
| void oak::Server::stop | ( | ) |
Stop the server.