Server extension that supports streaming requests of arbitrary size (file upload)
More...
Public Member Functions |
| | ~http_server () STATICLIB_NOEXCEPT |
| | http_server (uint32_t number_of_threads, uint16_t port, asio::ip::address_v4 ip_address=asio::ip::address_v4::any(), uint32_t read_timeout_millis=10000, const std::string &ssl_key_file=std::string(), std::function< std::string(std::size_t, asio::ssl::context::password_purpose)> ssl_key_password_callback=[](std::size_t, asio::ssl::context::password_purpose){return std::string();}, const std::string &ssl_verify_file=std::string(), std::function< bool(bool, asio::ssl::verify_context &)> ssl_verify_callback=[](bool, asio::ssl::verify_context &){return true;}) |
| | Creates a new server object.
|
| void | add_handler (const std::string &method, const std::string &resource, request_handler_type request_handler) |
| | Adds a new web service to the HTTP server.
|
| void | set_bad_request_handler (request_handler_type handler) |
| | Sets the function that handles bad HTTP requests.
|
| void | set_not_found_handler (request_handler_type handler) |
| | Sets the function that handles requests which match no other web services.
|
| void | add_payload_handler (const std::string &method, const std::string &resource, payload_handler_creator_type payload_handler) |
| | Adds a new payload_handler to the HTTP server.
|
| void | add_websocket_handler (const std::string &event, const std::string &resource, websocket_handler_type handler) |
| | Adds a new handler for WebSocket events.
|
| void | broadcast_websocket (const std::string &path, sl::io::span< const char > message, sl::websocket::frame_type frame_type=sl::websocket::frame_type::text, const std::set< std::string > &dest_ids=std::set< std::string >()) |
| | Broadcasts specified message to the WebSocket clients currently connected on the specified path.
|
| | tcp_server (const asio::ip::tcp::endpoint &endpoint, uint32_t number_of_threads) |
| | Protected constructor so that only derived objects may be created.
|
| | tcp_server (const tcp_server &) |
| | Deleted copy constructor.
|
| tcp_server & | operator= (const tcp_server &) |
| | Deleted copy assignment operator.
|
| virtual | ~tcp_server () STATICLIB_NOEXCEPT |
| | Virtual destructor.
|
| void | start () |
| | Starts listening for new connections.
|
| void | stop (bool wait_until_finished=false) |
| | Stops listening for new connections.
|
| bool | is_listening () const |
| | Returns true if the server is listening for connections.
|
| virtual void | handle_connection (tcp_connection_ptr &tcp_conn) |
| | Handles a new TCP connection; derived classes SHOULD override this since the default behavior does nothing.
|
| asio::io_service & | get_io_service () |
| | Returns an async I/O service used to schedule work.
|
| scheduler & | get_scheduler () |
| | Return active scheduler.
|
Additional Inherited Members |
| scheduler | active_scheduler |
| | Reference to the active scheduler object used to manage worker threads.
|
| asio::ip::tcp::acceptor | tcp_acceptor |
| | Manages async TCP connections.
|
| tcp_connection::ssl_context_type | ssl_context |
| | Context used for SSL configuration.
|
| std::condition_variable | server_has_stopped |
| | Condition triggered when the server has stopped listening for connections.
|
| std::condition_variable | no_more_connections |
| | Condition triggered when the connection pool is empty.
|
| std::set< tcp_connection_ptr > | conn_pool |
| | Pool of active connections associated with this server.
|
| asio::ip::tcp::endpoint | tcp_endpoint |
| | TCP endpoint used to listen for new connections.
|
| bool | ssl_flag |
| | true if the server uses SSL to encrypt connections
|
| bool | listening |
| | Set to true when the server is listening for new connections.
|
| std::mutex | mutex |
| | Mutex to make class thread-safe.
|
Server extension that supports streaming requests of arbitrary size (file upload)