https://issues.shibboleth.net/jira/browse/SSPCPP-204
[shibboleth/cpp-sp.git] / shibsp / remoting / impl / SocketListener.h
index 4544e36..f555e4d 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *  Copyright 2001-2007 Internet2
+ *  Copyright 2001-2009 Internet2
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -16,7 +16,7 @@
 
 /**
  * SocketListener.h
- * 
+ *
  * Berkeley Socket-based ListenerService implementation
  */
 
@@ -41,7 +41,7 @@ namespace shibsp {
 
     class SocketPool;
     class ServerThread;
-    
+
     /**
      * Berkeley Socket-based ListenerService implementation
      */
@@ -53,7 +53,18 @@ namespace shibsp {
         ~SocketListener();
 
         DDF send(const DDF& in);
-        bool run(bool* shutdown);
+
+#ifndef WIN32
+        bool setSignal(int s) {
+            m_signal = s;
+            return true;
+        }
+#endif
+
+        bool run(bool* shutdown) {
+            return run(true, shutdown);
+        }
+        bool run(bool force, bool* shutdown);
 
         // Implemented by socket-specific subclasses.
 #ifdef WIN32
@@ -69,13 +80,17 @@ namespace shibsp {
         virtual int send(ShibSocket& s, const char* buf, int len) const=0;
         virtual int recv(ShibSocket& s, char* buf, int buflen) const=0;
 
+        bool m_catchAll;
     protected:
         bool log_error() const; // for OS-level errors
         xmltooling::logging::Category* log;
         /// @endcond
-    
+
     private:
         mutable SocketPool* m_socketpool;
+#ifndef WIN32
+        int m_signal;
+#endif
         bool* m_shutdown;
 
         // Manage child threads