summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/socketengine.h19
1 files changed, 11 insertions, 8 deletions
diff --git a/include/socketengine.h b/include/socketengine.h
index fa2f26358..34dd306ba 100644
--- a/include/socketengine.h
+++ b/include/socketengine.h
@@ -266,20 +266,23 @@ class CoreExport SocketEngine
**/
static std::vector<EventHandler*> ref;
- protected:
- /** Current number of descriptors in the engine
- */
+ /** Current number of descriptors in the engine. */
static size_t CurrentSetSize;
+
+ /** The maximum number of descriptors in the engine. */
+ static size_t MaxSetSize;
+
/** List of handlers that want a trial read/write
*/
static std::set<int> trials;
- static int MAX_DESCRIPTORS;
-
/** Socket engine statistics: count of various events, bandwidth usage
*/
static Statistics stats;
+ /** Look up the fd limit using rlimit. */
+ static void LookupMaxFds();
+
static void OnSetEvent(EventHandler* eh, int old_mask, int new_mask);
/** Add an event handler to the base socket engine. AddFd(EventHandler*, int) should call this.
@@ -344,10 +347,10 @@ public:
/** Returns the number of file descriptors reported by the system this program may use
* when it was started.
- * @return If positive, the number of file descriptors that the system reported that we
- * may use. Otherwise (<= 0) this number could not be determined.
+ * @return If non-zero the number of file descriptors that the system reported that we
+ * may use.
*/
- static int GetMaxFds() { return MAX_DESCRIPTORS; }
+ static size_t GetMaxFds() { return MaxSetSize; }
/** Returns the number of file descriptors being queried
* @return The set size