29#ifndef Pt_Http_Server_h
30#define Pt_Http_Server_h
32#include <Pt/Http/Api.h>
33#include <Pt/Http/IOStream.h>
34#include <Pt/Connectable.h>
35#include <Pt/NonCopyable.h>
167 void shutdownServlet(
Servlet& servlet,
bool shutdown);
171 bool isServletIdle(
Servlet& servlet);
177 class ServerImpl* _impl;
Connectable()
Default constructor.
HTTP request message.
Definition Request.h:65
void cancel()
Cancel all operations.
void setSecure(Ssl::Context &ctx)
Enables HTTPS with ctx.
std::size_t maxRequestSize() const
Returns the maximum size of a request in bytes.
void listen(const Net::Endpoint &ep)
Start listening on endpoint.
void setMaxThreads(std::size_t m)
Sets the maximum number of server threads.
void setTimeout(std::size_t ms)
Sets the timeout in msecs.
void setMaxRequestSize(std::size_t maxSize)
Sets the maximum size of a request in bytes.
void removeServlet(Servlet &servlet)
Removes a servlet.
std::size_t timeout() const
Returns the timeout in msecs.
std::size_t keepAliveTimeout() const
Returns the keepalive timeout in msecs.
System::EventLoop * loop()
Returns the used event loop.
void setActive(System::EventLoop &loop)
Sets the event loop to use.
Server(System::EventLoop &loop, const Net::Endpoint &ep)
Construct with event loop and listen endpoint.
void setKeepAliveTimeout(std::size_t ms)
Sets the keepalive timeout in msecs.
Server(System::EventLoop &loop)
Construct with event loop.
void addServlet(Servlet &servlet)
Adds a servlet.
void listen(const Net::Endpoint &ep, const Net::TcpServerOptions &opts)
Start listening on endpoint.
std::size_t maxThreads() const
Returns the maximum number of server threads.
Server()
Default Constructor.
Maps requests to a service.
Definition Servlet.h:80
Host and service address.
Definition Endpoint.h:77
TCP server listen options.
Definition TcpServer.h:46
NonCopyable()
Default constructor.
Definition NonCopyable.h:63
Shared configuration for SSL connections.
Definition Context.h:113
Event loop of a thread or process.
Definition EventLoop.h:83
HTTP clients and servers.
TCP and UDP network sockets.
Definition Client.h:45
SSL/TLS streams, certificates and contexts.
Definition Client.h:50
System programming
Definition Connection.h:26
Core module.
Definition Allocator.h:33