identt
Public Member Functions | Protected Member Functions | List of all members
identt::http::HttpServer< HTTP > Class Template Reference
Inheritance diagram for identt::http::HttpServer< HTTP >:
identt::http::HttpServerBase< HTTP >

Public Member Functions

 HttpServer (unsigned short port) noexcept
 
- Public Member Functions inherited from identt::http::HttpServerBase< HTTP >
unsigned short bind ()
 If you know the server port in advance, use start() instead. More...
 
void accept_and_run ()
 If you know the server port in advance, use start() instead. More...
 
void start ()
 Start the server by calling bind() and accept_and_run()
 
void stop () noexcept
 Stop accepting new requests, and close current connections.
 

Protected Member Functions

void accept () override
 
- Protected Member Functions inherited from identt::http::HttpServerBase< HTTP >
 HttpServerBase (unsigned short port) noexcept
 
virtual void after_bind ()
 
std::shared_ptr< Connection > create_connection (Args &&... args) noexcept
 
void read (const std::shared_ptr< Session > &session)
 
void read_chunked_transfer_encoded (const std::shared_ptr< Session > &session, const std::shared_ptr< asio::streambuf > &chunks_streambuf)
 
void read_chunked_transfer_encoded_chunk (const std::shared_ptr< Session > &session, const std::shared_ptr< asio::streambuf > &chunks_streambuf, unsigned long length)
 
void find_resource (const std::shared_ptr< Session > &session)
 
void write (const std::shared_ptr< Session > &session, std::function< void(std::shared_ptr< typename HttpServerBase< HTTP >::Response >, std::shared_ptr< typename HttpServerBase< HTTP >::Request >)> &resource_function)
 

Additional Inherited Members

- Public Types inherited from identt::http::HttpServerBase< HTTP >
using RespPtr = std::shared_ptr< Response >
 
using ReqPtr = std::shared_ptr< Request >
 
- Public Attributes inherited from identt::http::HttpServerBase< HTTP >
Config config
 Set before calling start().
 
std::map< regex_orderable, std::map< std::string, std::function< void(std::shared_ptr< typename HttpServerBase< HTTP >::Response >, std::shared_ptr< typename HttpServerBase< HTTP >::Request >)> > > resource
 Use this container to add resources for specific request paths depending on the given regex and method. More...
 
std::map< std::string, std::function< void(std::shared_ptr< typename HttpServerBase< HTTP >::Response >, std::shared_ptr< typename HttpServerBase< HTTP >::Request >)> > default_resource
 If the request path does not match a resource regex, this function is called.
 
std::function< void(std::shared_ptr< typename HttpServerBase< HTTP >::Request >, const error_code &)> on_error
 Called when an error occurs.
 
std::function< void(std::unique_ptr< HTTP > &, std::shared_ptr< typename HttpServerBase< HTTP >::Request >)> on_upgrade
 Called on upgrade requests.
 
std::shared_ptr<::identt::http::io_whatever > io_whatever
 If you want to reuse an already created asio::io_service, store its pointer here before calling start().
 
- Protected Attributes inherited from identt::http::HttpServerBase< HTTP >
std::mutex start_stop_mutex
 
std::unique_ptr< asio::ip::tcp::acceptor > acceptor
 
std::shared_ptr< Connections > connections
 
std::shared_ptr< ScopeRunnerhandler_runner
 

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