-starting with service_new implementation data structures
authorChristian Grothoff <christian@grothoff.org>
Mon, 29 Aug 2016 11:53:43 +0000 (11:53 +0000)
committerChristian Grothoff <christian@grothoff.org>
Mon, 29 Aug 2016 11:53:43 +0000 (11:53 +0000)
src/util/service_new.c

index 953d3a8beffc125178d99bcdc62400e5cd193424..68988069fa6860b4a90445cfc85c48e186ede745 100644 (file)
 #include "gnunet_resolver_service.h"
 
 
+/**
+ * Information the service tracks per listen operation.
+ */
+struct ServiceListenContext
+{
+
+  /**
+   * Kept in a DLL.
+   */
+  struct ServiceListenContext *next;
+
+  /**
+   * Kept in a DLL.
+   */
+  struct ServiceListenContext *prev;
+
+  /**
+   * Service this listen context belongs to.
+   */
+  struct GNUNET_SERVICE_Handle *sh;
+
+  /**
+   * Socket we are listening on.
+   */
+  struct GNUNET_NETWORK_Handle *listen_socket;
+
+  /**
+   * Task scheduled to do the listening.
+   */
+  struct GNUNET_SCHEDULER_Task *listen_task;
+
+};
+
+
 /**
  * Handle to a service.
  */
@@ -65,6 +99,16 @@ struct GNUNET_SERVICE_Handle
    */
   void *cb_cls;
 
+  /**
+   * DLL of listen sockets used to accept new connections.
+   */
+  struct ServiceListenContext *slc_head;
+
+  /**
+   * DLL of listen sockets used to accept new connections.
+   */
+  struct ServiceListenContext *slc_tail;
+
   /**
    * Message handlers to use for all clients.
    */