Factory type for the with(...).accept(...).start(...)
DSL.
More...
#include <server_factory.hpp>
|
template<class Token , class... Args> |
| server_factory (Token token, const dsl::generic_config_value &from, Args &&... args) |
|
| server_factory (server_factory &&other) noexcept |
|
server_factory & | operator= (server_factory &&other) noexcept |
|
server_factory && | max_request_size (size_t value) && |
| Sets the maximum request size to value .
|
|
template<class ActorHandle > |
server_factory && | monitor (const ActorHandle &hdl) && |
| Monitors the actor handle hdl and stops the server if the monitored actor terminates.
|
|
template<class F > |
server_factory && | route (std::string path, F f) && |
| Adds a new route to the HTTP server.
|
|
template<class F > |
server_factory && | route (std::string path, http::method method, F f) && |
| Adds a new route to the HTTP server.
|
|
template<class OnStart > |
expected< disposable > | start (OnStart on_start) && |
| Starts a server that makes HTTP requests without a fixed route available to an observer.
|
|
expected< disposable > | start () && |
| Starts a server that only serves the fixed routes.
|
|
server_factory && | do_on_error (F callback) && |
| Sets the callback for errors.
|
|
server_factory && | max_connections (size_t value) && |
| Configures how many concurrent connections the server accepts.
|
|
server_factory && | reuse_address (bool value) && |
| Configures whether the server creates its socket with SO_REUSEADDR .
|
|
|
dsl::server_config_value & | base_config () override |
|
server_factory && | dref () |
|
auto | with_ssl_acceptor_or_socket (Fn &&fn) |
|
Factory type for the with(...).accept(...).start(...)
DSL.
◆ base_config()
dsl::server_config_value & caf::net::http::server_factory::base_config |
( |
| ) |
|
|
overrideprotectedvirtual |
◆ route() [1/2]
template<class F >
server_factory && caf::net::http::server_factory::route |
( |
std::string | path, |
|
|
F | f ) && |
Adds a new route to the HTTP server.
- Parameters
-
path | The path on this server for the new route. |
f | The function object for handling requests on the new route. |
- Returns
- a reference to
*this
.
◆ route() [2/2]
Adds a new route to the HTTP server.
- Parameters
-
path | The path on this server for the new route. |
method | The allowed HTTP method on the new route. |
f | The function object for handling requests on the new route. |
- Returns
- a reference to
*this
.
The documentation for this class was generated from the following files:
- libcaf_net/caf/net/http/server_factory.hpp
- libcaf_net/caf/net/http/server_factory.cpp