| 1 | // |
|---|---|
| 2 | // HTTPServerParams.cpp |
| 3 | // |
| 4 | // Library: Net |
| 5 | // Package: HTTPServer |
| 6 | // Module: HTTPServerParams |
| 7 | // |
| 8 | // Copyright (c) 2005-2006, Applied Informatics Software Engineering GmbH. |
| 9 | // and Contributors. |
| 10 | // |
| 11 | // SPDX-License-Identifier: BSL-1.0 |
| 12 | // |
| 13 | |
| 14 | |
| 15 | #include "Poco/Net/HTTPServerParams.h" |
| 16 | |
| 17 | |
| 18 | namespace Poco { |
| 19 | namespace Net { |
| 20 | |
| 21 | |
| 22 | HTTPServerParams::HTTPServerParams(): |
| 23 | _timeout(60000000), |
| 24 | _keepAlive(true), |
| 25 | _maxKeepAliveRequests(0), |
| 26 | _keepAliveTimeout(15000000) |
| 27 | { |
| 28 | } |
| 29 | |
| 30 | |
| 31 | HTTPServerParams::~HTTPServerParams() |
| 32 | { |
| 33 | } |
| 34 | |
| 35 | |
| 36 | void HTTPServerParams::setServerName(const std::string& serverName) |
| 37 | { |
| 38 | _serverName = serverName; |
| 39 | } |
| 40 | |
| 41 | |
| 42 | void HTTPServerParams::setSoftwareVersion(const std::string& softwareVersion) |
| 43 | { |
| 44 | _softwareVersion = softwareVersion; |
| 45 | } |
| 46 | |
| 47 | |
| 48 | void HTTPServerParams::setTimeout(const Poco::Timespan& timeout) |
| 49 | { |
| 50 | _timeout = timeout; |
| 51 | } |
| 52 | |
| 53 | |
| 54 | void HTTPServerParams::setKeepAlive(bool keepAlive) |
| 55 | { |
| 56 | _keepAlive = keepAlive; |
| 57 | } |
| 58 | |
| 59 | |
| 60 | void HTTPServerParams::setKeepAliveTimeout(const Poco::Timespan& timeout) |
| 61 | { |
| 62 | _keepAliveTimeout = timeout; |
| 63 | } |
| 64 | |
| 65 | |
| 66 | void HTTPServerParams::setMaxKeepAliveRequests(int maxKeepAliveRequests) |
| 67 | { |
| 68 | poco_assert (maxKeepAliveRequests >= 0); |
| 69 | _maxKeepAliveRequests = maxKeepAliveRequests; |
| 70 | } |
| 71 | |
| 72 | |
| 73 | } } // namespace Poco::Net |
| 74 |