Add getConnectionCount method (#1731)
This commit is contained in:
parent
5c43b82dc2
commit
3aa93e62e7
|
@ -1521,6 +1521,10 @@ class DROGON_EXPORT HttpAppFramework : public trantor::NonCopyable
|
|||
|
||||
virtual HttpAppFramework &enableCompressedRequest(bool enable = true) = 0;
|
||||
virtual bool isCompressedRequestEnabled() const = 0;
|
||||
/*
|
||||
* @brief get the number of active connections.
|
||||
*/
|
||||
virtual int64_t getConnectionCount() const = 0;
|
||||
|
||||
private:
|
||||
virtual void registerHttpController(
|
||||
|
|
|
@ -606,6 +606,11 @@ class HttpAppFrameworkImpl final : public HttpAppFramework
|
|||
const std::string &ext,
|
||||
const std::string &mime) override;
|
||||
|
||||
int64_t getConnectionCount() const override
|
||||
{
|
||||
return connectionNum_.load(std::memory_order_relaxed);
|
||||
}
|
||||
|
||||
private:
|
||||
void registerHttpController(const std::string &pathPattern,
|
||||
const internal::HttpBinderBasePtr &binder,
|
||||
|
|
Loading…
Reference in New Issue