class Poco::Net::HTTPServerParams
Overview
This class is used to specify parameters to both the HTTPServer, as well as to HTTPRequestHandler objects. Moreā¦
#include <HTTPServerParams.h> class HTTPServerParams: public Poco::Net::TCPServerParams { public: // typedefs typedef Poco::AutoPtr<HTTPServerParams> Ptr; // methods void setServerName(const std::string& serverName); const std::string& getServerName() const; void setSoftwareVersion(const std::string& softwareVersion); const std::string& getSoftwareVersion() const; void setTimeout(const Poco::Timespan& timeout); const Poco::Timespan& getTimeout() const; void setKeepAlive(bool keepAlive); bool getKeepAlive() const; void setKeepAliveTimeout(const Poco::Timespan& timeout); const Poco::Timespan& getKeepAliveTimeout() const; void setMaxKeepAliveRequests(int maxKeepAliveRequests); int getMaxKeepAliveRequests() const; };
Inherited Members
public: // typedefs typedef Poco::AutoPtr<TCPServerParams> Ptr; // methods void duplicate() const; void release() const; int referenceCount() const; void setThreadIdleTime(const Poco::Timespan& idleTime); const Poco::Timespan& getThreadIdleTime() const; void setMaxQueued(int count); int getMaxQueued() const; void setMaxThreads(int count); int getMaxThreads() const; void setThreadPriority(Poco::Thread::Priority prio); Poco::Thread::Priority getThreadPriority() const;
Detailed Documentation
This class is used to specify parameters to both the HTTPServer, as well as to HTTPRequestHandler objects.
Subclasses may add new parameters to the class.
Methods
void setServerName(const std::string& serverName)
Sets the name and port (name:port) that the server uses to identify itself.
If this is not set to valid DNS name for your host, server-generated redirections will not work.
const std::string& getServerName() const
Returns the name and port (name:port) that the server uses to identify itself.
void setSoftwareVersion(const std::string& softwareVersion)
Sets the server software name and version that the server uses to identify itself.
If this is set to a non-empty string, the server will automatically include a Server header field with the value given here in every response it sends.
The format of the softwareVersion string should be name/version (e.g. MyHTTPServer/1.0).
const std::string& getSoftwareVersion() const
Returns the server software name and version that the server uses to identify itself.
void setTimeout(const Poco::Timespan& timeout)
Sets the connection timeout for HTTP connections.
const Poco::Timespan& getTimeout() const
Returns the connection timeout for HTTP connections.
void setKeepAlive(bool keepAlive)
Enables (keepAlive == true) or disables (keepAlive == false) persistent connections.
bool getKeepAlive() const
Returns true iff persistent connections are enabled.
void setKeepAliveTimeout(const Poco::Timespan& timeout)
Sets the connection timeout for HTTP connections.
const Poco::Timespan& getKeepAliveTimeout() const
Returns the connection timeout for HTTP connections.
void setMaxKeepAliveRequests(int maxKeepAliveRequests)
Specifies the maximum number of requests allowed during a persistent connection.
0 means unlimited connections.
int getMaxKeepAliveRequests() const
Returns the maximum number of requests allowed during a persistent connection, or 0 if unlimited connections are allowed.