-/*
- * Copyright 2001-2009 Internet2
+/**
+ * Licensed to the University Corporation for Advanced Internet
+ * Development, Inc. (UCAID) under one or more contributor license
+ * agreements. See the NOTICE file distributed with this work for
+ * additional information regarding copyright ownership.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * UCAID licenses this file to you under the Apache License,
+ * Version 2.0 (the "License"); you may not use this file except
+ * in compliance with the License. You may obtain a copy of the
+ * License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
+ * either express or implied. See the License for the specific
+ * language governing permissions and limitations under the License.
*/
/**
* SocketListener.h
*
- * Berkeley Socket-based ListenerService implementation
+ * Berkeley Socket-based ListenerService implementation.
*/
#ifndef __shibsp_socklisten_h__
#include <xmltooling/util/Threads.h>
#ifdef WIN32
-# include <winsock.h>
+# include <winsock2.h>
#endif
namespace shibsp {
DDF send(const DDF& in);
-#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);
+ bool init(bool force);
+ bool run(bool* shutdown);
+ void term();
// Implemented by socket-specific subclasses.
#ifdef WIN32
bool m_catchAll;
protected:
- bool log_error() const; // for OS-level errors
+ bool log_error(const char* fn=nullptr) 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
xmltooling::Mutex* m_child_lock;
xmltooling::CondWait* m_child_wait;
+ unsigned int m_stackSize;
+
// Primary socket
ShibSocket m_socket;
};