int require_found);
+/**
+ * Stop the listen socket and get ready to shutdown the server
+ * once only 'monitor' clients are left.
+ *
+ * @param server server to stop listening on
+ */
+void
+GNUNET_SERVER_stop_listening (struct GNUNET_SERVER_Handle *server);
+
+
/**
* Free resources held by this server.
*
GNUNET_SERVER_notify_transmit_ready_cancel (struct GNUNET_SERVER_TransmitHandle *th);
+/**
+ * Set the 'monitor' flag on this client. Clients which have been
+ * marked as 'monitors' won't prevent the server from shutting down
+ * once 'GNUNET_SERVER_stop_listening' has been invoked. The idea is
+ * that for "normal" clients we likely want to allow them to process
+ * their requests; however, monitor-clients are likely to 'never'
+ * disconnect during shutdown and thus will not be considered when
+ * determining if the server should continue to exist after
+ * 'GNUNET_SERVER_destroy' has been called.
+ *
+ * @param client the client to set the 'monitor' flag on
+ */
+void
+GNUNET_SERVER_client_mark_monitor (struct GNUNET_SERVER_Client *client);
+
+
/**
* Set the persistent flag on this client, used to setup client connection
* to only be killed when the service it's connected to is actually dead.
* Functions with this signature are called whenever a
* complete message is received by the tokenizer.
*
+ * Do not call GNUNET_SERVER_mst_destroy in callback
+ *
* @param cls closure
* @param client identification of the client
* @param message the actual message
+ *
+ * @return GNUNET_OK on success, GNUNET_SYSERR to stop further processing
*/
-typedef void (*GNUNET_SERVER_MessageTokenizerCallback) (void *cls, void *client,
+typedef int (*GNUNET_SERVER_MessageTokenizerCallback) (void *cls, void *client,
const struct
GNUNET_MessageHeader *
message);