diff options
author | Christian Grothoff <christian@grothoff.org> | 2016-08-29 11:29:41 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2016-08-29 11:29:41 +0000 |
commit | ac40d74f85dd2a0cbacf520d4456c6746c64e12e (patch) | |
tree | 3dab880d56b4769587ae6e756481c532b6adee6e /src/include/gnunet_service_lib.h | |
parent | 6ad7f6037f6c56b0225118b6a641d66c16263f3a (diff) | |
download | gnunet-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.h | 42 |
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, | |||
363 | void | 363 | void |
364 | GNUNET_SERVICE_suspend (struct GNUNET_SERVICE_Handle *sh); | 364 | GNUNET_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); | |||
371 | void | 372 | void |
372 | GNUNET_SERVICE_resume (struct GNUNET_SERVICE_Handle *sh); | 373 | GNUNET_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); | |||
380 | void | 382 | void |
381 | GNUNET_SERVICE_client_continue (struct GNUNET_SERVICE_Client *c); | 383 | GNUNET_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 | */ |
385 | void | 394 | void |
386 | GNUNET_SERVICE_client_disable_continue_warning (struct GNUNET_SERVICE_Client *c); | 395 | GNUNET_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 | */ |
392 | void | 406 | void |
393 | GNUNET_SERVICE_client_drop (struct GNUNET_SERVICE_Client *c); | 407 | GNUNET_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 | */ |
399 | void | 417 | void |
400 | GNUNET_SERVICE_stop_listening (struct GNUNET_SERVICE_Handle *sh); | 418 | GNUNET_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 | */ |
406 | void | 433 | void |
407 | GNUNET_SERVICE_client_mark_monitor (struct GNUNET_SERVICE_Client *c); | 434 | GNUNET_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 | */ |
413 | void | 444 | void |
414 | GNUNET_SERVICE_client_persist (struct GNUNET_SERVICE_Client *c); | 445 | GNUNET_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 |