aboutsummaryrefslogtreecommitdiff
path: root/src/include/gnunet_service_lib.h
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2016-08-29 11:29:41 +0000
committerChristian Grothoff <christian@grothoff.org>2016-08-29 11:29:41 +0000
commitac40d74f85dd2a0cbacf520d4456c6746c64e12e (patch)
tree3dab880d56b4769587ae6e756481c532b6adee6e /src/include/gnunet_service_lib.h
parent6ad7f6037f6c56b0225118b6a641d66c16263f3a (diff)
downloadgnunet-ac40d74f85dd2a0cbacf520d4456c6746c64e12e.tar.gz
gnunet-ac40d74f85dd2a0cbacf520d4456c6746c64e12e.zip
-document new API
Diffstat (limited to 'src/include/gnunet_service_lib.h')
-rw-r--r--src/include/gnunet_service_lib.h42
1 files changed, 36 insertions, 6 deletions
diff --git a/src/include/gnunet_service_lib.h b/src/include/gnunet_service_lib.h
index 85b8f5f9c..f7d2f781c 100644
--- a/src/include/gnunet_service_lib.h
+++ b/src/include/gnunet_service_lib.h
@@ -363,6 +363,7 @@ GNUNET_SERVICE_ruN_ (int argc,
363void 363void
364GNUNET_SERVICE_suspend (struct GNUNET_SERVICE_Handle *sh); 364GNUNET_SERVICE_suspend (struct GNUNET_SERVICE_Handle *sh);
365 365
366
366/** 367/**
367 * Resume accepting connections from the listen socket. 368 * Resume accepting connections from the listen socket.
368 * 369 *
@@ -371,6 +372,7 @@ GNUNET_SERVICE_suspend (struct GNUNET_SERVICE_Handle *sh);
371void 372void
372GNUNET_SERVICE_resume (struct GNUNET_SERVICE_Handle *sh); 373GNUNET_SERVICE_resume (struct GNUNET_SERVICE_Handle *sh);
373 374
375
374/** 376/**
375 * Continue receiving further messages from the given client. 377 * Continue receiving further messages from the given client.
376 * Must be called after each message received. 378 * Must be called after each message received.
@@ -380,41 +382,69 @@ GNUNET_SERVICE_resume (struct GNUNET_SERVICE_Handle *sh);
380void 382void
381GNUNET_SERVICE_client_continue (struct GNUNET_SERVICE_Client *c); 383GNUNET_SERVICE_client_continue (struct GNUNET_SERVICE_Client *c);
382 384
385
383/** 386/**
387 * Disable the warning the server issues if a message is not
388 * acknowledged in a timely fashion. Use this call if a client is
389 * intentionally delayed for a while. Only applies to the current
390 * message.
391 *
392 * @param c client for which to disable the warning
384 */ 393 */
385void 394void
386GNUNET_SERVICE_client_disable_continue_warning (struct GNUNET_SERVICE_Client *c); 395GNUNET_SERVICE_client_disable_continue_warning (struct GNUNET_SERVICE_Client *c);
387 396
397
388/** 398/**
399 * Ask the server to disconnect from the given client. This is the
400 * same as returning #GNUNET_SYSERR within the check procedure when
401 * handling a message, wexcept that it allows dropping of a client even
402 * when not handling a message from that client.
389 * 403 *
390 * @param c 404 * @param c client to disconnect now
391 */ 405 */
392void 406void
393GNUNET_SERVICE_client_drop (struct GNUNET_SERVICE_Client *c); 407GNUNET_SERVICE_client_drop (struct GNUNET_SERVICE_Client *c);
394 408
409
395/** 410/**
411 * Stop the listen socket and get ready to shutdown the server once
412 * only clients marked using #GNUNET_SERVER_client_mark_monitor are
413 * left.
396 * 414 *
397 * @param sh 415 * @param sh server to stop listening on
398 */ 416 */
399void 417void
400GNUNET_SERVICE_stop_listening (struct GNUNET_SERVICE_Handle *sh); 418GNUNET_SERVICE_stop_listening (struct GNUNET_SERVICE_Handle *sh);
401 419
420
402/** 421/**
403 * 422 * Set the 'monitor' flag on this client. Clients which have been
404 * @param c 423 * marked as 'monitors' won't prevent the server from shutting down
424 * once #GNUNET_SERVICE_stop_listening() has been invoked. The idea is
425 * that for "normal" clients we likely want to allow them to process
426 * their requests; however, monitor-clients are likely to 'never'
427 * disconnect during shutdown and thus will not be considered when
428 * determining if the server should continue to exist after
429 * shutdown has been triggered.
430 *
431 * @param c client to mark as a monitor
405 */ 432 */
406void 433void
407GNUNET_SERVICE_client_mark_monitor (struct GNUNET_SERVICE_Client *c); 434GNUNET_SERVICE_client_mark_monitor (struct GNUNET_SERVICE_Client *c);
408 435
436
409/** 437/**
438 * Set the persist option on this client. Indicates that the
439 * underlying socket or fd should never really be closed. Used for
440 * indicating process death.
410 * 441 *
411 * @param c 442 * @param c client to persist the socket (never to be closed)
412 */ 443 */
413void 444void
414GNUNET_SERVICE_client_persist (struct GNUNET_SERVICE_Client *c); 445GNUNET_SERVICE_client_persist (struct GNUNET_SERVICE_Client *c);
415 446
416 447
417
418#if 0 /* keep Emacsens' auto-indent happy */ 448#if 0 /* keep Emacsens' auto-indent happy */
419{ 449{
420#endif 450#endif