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>
46 class TcpServerOptions;
143 void shutdownServlet(
Servlet& servlet,
bool shutdown);
147 bool isServletIdle(
Servlet& servlet);
155 class ServerImpl* _impl;
162 #endif // Pt_Http_Server_h
Core module.
Definition: Allocator.h:33
Server()
Default Constructor.
void setTimeout(std::size_t ms)
Sets the timeout in msecs.
HTTP request message.
Definition: Request.h:44
void setMaxThreads(std::size_t m)
Sets the maximum number of server threads.
Multicast Signal to call multiple slots.
Definition: Api-Signal.h:111
void cancel()
Cancel all operations.
void addServlet(Servlet &servlet)
Adds a servlet.
Servlet for HTTP services.
Definition: Servlet.h:53
void setActive(System::EventLoop &loop)
Sets the event loop to use.
TCP server options.
Definition: TcpServer.h:44
std::size_t timeout() const
Returns the timeout in msecs.
Connection Management for Signal and Slot Objects.
Definition: Connectable.h:50
void setMaxRequestSize(std::size_t maxSize)
Sets the maximum size of a request in bytes.
Represents a Network Host.
Definition: Endpoint.h:47
std::size_t maxRequestSize() const
Returns the maximum size of a request in bytes.
System::EventLoop * loop()
Returns the used event loop.
std::size_t keepAliveTimeout() const
Returns the keepalive timeout in msecs.
An HTTP server.
Definition: Server.h:59
Thread-safe event loop supporting I/O multiplexing and Timers.
Definition: EventLoop.h:74
Server(System::EventLoop &loop)
Construct with event loop.
void removeServlet(Servlet &servlet)
Removes a servlet.
std::size_t maxThreads() const
Returns the maximum number of server threads.
void setKeepAliveTimeout(std::size_t ms)
Sets the keepalive timeout in msecs.
Protects derived classes from being copied.
Definition: NonCopyable.h:54
void listen(const Net::Endpoint &ep)
Start listening on endpoint.
void setSecure(Ssl::Context &ctx)
Enables to use HTTPS.
void listen(const Net::Endpoint &ep, const Net::TcpServerOptions &opts)
Start listening on endpoint.
Server(System::EventLoop &loop, const Net::Endpoint &ep)
Construct with event loop and listen endpoint.
Context for SSL connections.
Definition: Context.h:80