diff options
author | Christian Grothoff <christian@grothoff.org> | 2016-07-29 20:31:52 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2016-07-29 20:31:52 +0000 |
commit | 1e2d3aaecc2a4130e35d46a7c03b9d80d34d6673 (patch) | |
tree | 2a1f83390b22383ced0e61d8c847886f3c163601 /src/core | |
parent | c23a4218f8a59ad08c82d485db37a897cac4b358 (diff) | |
download | gnunet-1e2d3aaecc2a4130e35d46a7c03b9d80d34d6673.tar.gz gnunet-1e2d3aaecc2a4130e35d46a7c03b9d80d34d6673.zip |
starting point for MQ-core API
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/core_api.c | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/src/core/core_api.c b/src/core/core_api.c index caf614afc..acdac5fa4 100644 --- a/src/core/core_api.c +++ b/src/core/core_api.c | |||
@@ -917,6 +917,44 @@ GNUNET_CORE_connect (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
917 | 917 | ||
918 | 918 | ||
919 | /** | 919 | /** |
920 | * Connect to the core service. Note that the connection may complete | ||
921 | * (or fail) asynchronously. This function primarily causes the given | ||
922 | * callback notification functions to be invoked whenever the | ||
923 | * specified event happens. The maximum number of queued | ||
924 | * notifications (queue length) is per client; the queue is shared | ||
925 | * across all types of notifications. So a slow client that registers | ||
926 | * for @a outbound_notify also risks missing @a inbound_notify messages. | ||
927 | * Certain events (such as connect/disconnect notifications) are not | ||
928 | * subject to queue size limitations. | ||
929 | * | ||
930 | * @param cfg configuration to use | ||
931 | * @param cls closure for the various callbacks that follow (including handlers in the handlers array) | ||
932 | * @param init callback to call once we have successfully | ||
933 | * connected to the core service | ||
934 | * @param connects function to call on peer connect, can be NULL | ||
935 | * @param disconnects function to call on peer disconnect / timeout, can be NULL | ||
936 | * @param handlers callbacks for messages we care about, NULL-terminated | ||
937 | * note that the core is allowed to drop notifications about inbound | ||
938 | * messages if the client does not process them fast enough (for this | ||
939 | * notification type, a bounded queue is used) | ||
940 | * @return handle to the core service (only useful for disconnect until @a init is called), | ||
941 | * NULL on error (in this case, init is never called) | ||
942 | */ | ||
943 | struct GNUNET_CORE_Handle * | ||
944 | GNUNET_CORE_connecT (const struct GNUNET_CONFIGURATION_Handle *cfg, | ||
945 | void *cls, | ||
946 | GNUNET_CORE_StartupCallback init, | ||
947 | GNUNET_CORE_ConnecTEventHandler connects, | ||
948 | GNUNET_CORE_DisconnecTEventHandler disconnects, | ||
949 | const struct GNUNET_MQ_MessageHandler *handlers) | ||
950 | { | ||
951 | GNUNET_break (0); // not implemented | ||
952 | // NOTE: re-enable core-related tests in ats-tests/ once implemented! | ||
953 | return NULL; | ||
954 | } | ||
955 | |||
956 | |||
957 | /** | ||
920 | * Disconnect from the core service. This function can only | 958 | * Disconnect from the core service. This function can only |
921 | * be called *after* all pending #GNUNET_CORE_notify_transmit_ready() | 959 | * be called *after* all pending #GNUNET_CORE_notify_transmit_ready() |
922 | * requests have been explicitly canceled. | 960 | * requests have been explicitly canceled. |