Library: Net
Package: HTTPServer
Header: Poco/Net/HTTPServerParams.h
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.
Direct Base Classes: TCPServerParams
All Base Classes: TCPServerParams, Poco::RefCountedObject
Member Functions: getKeepAlive, getKeepAliveTimeout, getMaxKeepAliveRequests, getServerName, getSoftwareVersion, getTimeout, setKeepAlive, setKeepAliveTimeout, setMaxKeepAliveRequests, setServerName, setSoftwareVersion, setTimeout
Inherited Functions: duplicate, getMaxQueued, getMaxThreads, getThreadIdleTime, getThreadPriority, referenceCount, release, setMaxQueued, setMaxThreads, setThreadIdleTime, setThreadPriority
Creates the HTTPServerParams.
Sets the following default values:
virtual ~HTTPServerParams();
Destroys the HTTPServerParams.
bool getKeepAlive() const;
Returns true iff persistent connections are enabled.
const Poco::Timespan & getKeepAliveTimeout() const;
Returns the connection timeout for HTTP connections.
int getMaxKeepAliveRequests() const;
Returns the maximum number of requests allowed during a persistent connection, or 0 if unlimited connections are allowed.
const std::string & getServerName() const;
Returns the name and port (name:port) that the server uses to identify itself.
const std::string & getSoftwareVersion() const;
Returns the server software name and version that the server uses to identify itself.
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.
void setKeepAliveTimeout(
const Poco::Timespan & timeout
);
Sets the connection timeout for HTTP connections.
void setMaxKeepAliveRequests(
int maxKeepAliveRequests
);
Specifies the maximun number of requests allowed during a persistent connection. 0 means unlimited connections.
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.
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).
void setTimeout(
const Poco::Timespan & timeout
);
Sets the connection timeout for HTTP connections.