Merge pull request #592 from xandross389/get-some-server-running-params

Add functions that return info about server's threads number and bind address.
This commit is contained in:
Igor Mróz 2023-02-11 20:18:16 +01:00 committed by GitHub
commit e041d35d99
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 12 additions and 1 deletions

View File

@ -167,7 +167,6 @@ namespace crow
return port_;
}
/// Set the connection timeout in seconds (default is 5)
self_t& timeout(std::uint8_t timeout)
{
@ -188,6 +187,12 @@ namespace crow
bindaddr_ = bindaddr;
return *this;
}
/// Get the address that Crow will handle requests on
std::string bindaddr()
{
return bindaddr_;
}
/// Run the server on multiple threads using all available threads
self_t& multithreaded()
@ -203,6 +208,12 @@ namespace crow
concurrency_ = concurrency;
return *this;
}
/// Get the number of threads that server is using
std::uint16_t concurrency()
{
return concurrency_;
}
/// Set the server's log level