index ba33d13c194ff575774108ac5bf1af4cc7954b2c..2b93a6f724d1adaca687d81e149fa49fecb5bf68 100644 (file)
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+#include <unistd.h>
+
#ifndef SDB_FRONTEND_SOCK_H
#define SDB_FRONTEND_SOCK_H 1
/* manage a front-end listener loop */
typedef struct {
+ /* number of handler threads to create */
+ size_t num_threads;
+
+ /* front-end listener shuts down when this is set to false */
_Bool do_loop;
} sdb_fe_loop_t;
-#define SDB_FE_LOOP_INIT { 1 }
+#define SDB_FE_LOOP_INIT { 5, 1 }
/*
* sdb_fe_socket_t:
int
sdb_fe_sock_add_listener(sdb_fe_socket_t *sock, const char *address);
+/*
+ * sdb_fe_sock_clear_listeners:
+ * Shut down all listeners from the socket object and clear the list of
+ * listeners. All open connections will not be affected by this.
+ */
+void
+sdb_fe_sock_clear_listeners(sdb_fe_socket_t *sock);
+
/*
* sdb_fe_sock_listen_and_serve:
* Listen on the specified socket and serve client requests. The loop
- * terminates on error or when the loop condition turns to false.
+ * terminates on error or when the loop condition turns to false. All
+ * listening sockets will be closed at that time.
*
* Returns:
* - 0 on success