summaryrefslogtreecommitdiff
path: root/src/base/socket.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/base/socket.cc')
-rw-r--r--src/base/socket.cc18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/base/socket.cc b/src/base/socket.cc
index adcc48735..bcc5236b0 100644
--- a/src/base/socket.cc
+++ b/src/base/socket.cc
@@ -43,6 +43,23 @@
using namespace std;
+bool ListenSocket::listeningDisabled = false;
+bool ListenSocket::anyListening = false;
+
+void
+ListenSocket::disableAll()
+{
+ if (anyListening)
+ panic("Too late to disable all listeners, already have a listener");
+ listeningDisabled = true;
+}
+
+bool
+ListenSocket::allDisabled()
+{
+ return listeningDisabled;
+}
+
////////////////////////////////////////////////////////////////////////
//
//
@@ -92,6 +109,7 @@ ListenSocket::listen(int port, bool reuse)
listening = true;
+ anyListening = true;
return true;
}