aboutsummaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
Diffstat (limited to 'src/include')
-rw-r--r--src/include/gnunet_client_lib.h25
-rw-r--r--src/include/gnunet_connection_lib.h9
-rw-r--r--src/include/gnunet_constants.h2
-rw-r--r--src/include/gnunet_protocols.h12
-rw-r--r--src/include/gnunet_server_lib.h12
5 files changed, 57 insertions, 3 deletions
diff --git a/src/include/gnunet_client_lib.h b/src/include/gnunet_client_lib.h
index 21487eb04..56f6915a4 100644
--- a/src/include/gnunet_client_lib.h
+++ b/src/include/gnunet_client_lib.h
@@ -106,6 +106,19 @@ typedef void (*GNUNET_CLIENT_MessageHandler) (void *cls,
106 GNUNET_MessageHeader * msg); 106 GNUNET_MessageHeader * msg);
107 107
108/** 108/**
109 * Type of a function to call when we have finished shutting
110 * down a service, or failed.
111 *
112 * @param cls closure
113 * @param reason what is the result of the shutdown
114 * GNUNET_NO on shutdown (not running)
115 * GNUNET_YES on running
116 * GNUNET_SYSERR on failure to transmit message
117 */
118typedef void (*GNUNET_CLIENT_ShutdownTask) (void *cls,
119 int reason);
120
121/**
109 * Read from the service. 122 * Read from the service.
110 * 123 *
111 * @param sock the service 124 * @param sock the service
@@ -202,9 +215,19 @@ GNUNET_CLIENT_transmit_and_get_response (struct GNUNET_CLIENT_Connection *sock,
202 * be used by the caller after this call 215 * be used by the caller after this call
203 * (calling this function frees "sock" after a while). 216 * (calling this function frees "sock" after a while).
204 * 217 *
218 * @param sched the scheduler to use for calling shutdown continuation
205 * @param sock the socket connected to the service 219 * @param sock the socket connected to the service
220 * @param timeout how long to wait before giving up on transmission
221 * @param cont continuation to call once the service is really down
222 * @param cont_cls closure for continuation
223 *
206 */ 224 */
207void GNUNET_CLIENT_service_shutdown (struct GNUNET_CLIENT_Connection *sock); 225void
226GNUNET_CLIENT_service_shutdown (struct GNUNET_SCHEDULER_Handle *sched,
227 struct GNUNET_CLIENT_Connection *sock,
228 struct GNUNET_TIME_Relative timeout,
229 GNUNET_CLIENT_ShutdownTask cont,
230 void *cont_cls);
208 231
209 232
210/** 233/**
diff --git a/src/include/gnunet_connection_lib.h b/src/include/gnunet_connection_lib.h
index 0f6ae21e3..9701eb149 100644
--- a/src/include/gnunet_connection_lib.h
+++ b/src/include/gnunet_connection_lib.h
@@ -84,6 +84,15 @@ typedef void (*GNUNET_CONNECTION_Receiver) (void *cls,
84 const struct sockaddr * addr, 84 const struct sockaddr * addr,
85 socklen_t addrlen, int errCode); 85 socklen_t addrlen, int errCode);
86 86
87/**
88 * Set the persist option on this connection handle. Indicates
89 * that the underlying socket or fd should never really be closed.
90 * Used for indicating process death.
91 *
92 * @param sock the connection to set persistent
93 */
94void
95GNUNET_CONNECTION_persist_(struct GNUNET_CONNECTION_Handle *sock);
87 96
88/** 97/**
89 * Create a socket handle by boxing an existing OS socket. The OS 98 * Create a socket handle by boxing an existing OS socket. The OS
diff --git a/src/include/gnunet_constants.h b/src/include/gnunet_constants.h
index bfb36a2ea..b8e280d4e 100644
--- a/src/include/gnunet_constants.h
+++ b/src/include/gnunet_constants.h
@@ -60,7 +60,7 @@ extern "C"
60 * How long do we wait after a FORK+EXEC before testing for the 60 * How long do we wait after a FORK+EXEC before testing for the
61 * resulting process to be up (port open, waitpid, etc.)? 61 * resulting process to be up (port open, waitpid, etc.)?
62 */ 62 */
63#define GNUNET_CONSTANTS_EXEC_WAIT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MILLISECONDS, 100) 63#define GNUNET_CONSTANTS_EXEC_WAIT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MILLISECONDS, 200)
64 64
65/** 65/**
66 * After how long do we consider a service irresponsive 66 * After how long do we consider a service irresponsive
diff --git a/src/include/gnunet_protocols.h b/src/include/gnunet_protocols.h
index 501bf17ef..069c6d5ee 100644
--- a/src/include/gnunet_protocols.h
+++ b/src/include/gnunet_protocols.h
@@ -104,6 +104,18 @@ extern "C"
104 */ 104 */
105#define GNUNET_MESSAGE_TYPE_ARM_IS_UNKNOWN 12 105#define GNUNET_MESSAGE_TYPE_ARM_IS_UNKNOWN 12
106 106
107/**
108 * Acknowledge service shutting down, disconnect
109 * indicates service stopped.
110 */
111#define GNUNET_MESSAGE_TYPE_SHUTDOWN_ACK 13
112
113/**
114 * Deny service shutdown, disconnect indicates
115 * service won't be stopped as a result of shutdown
116 * message.
117 */
118#define GNUNET_MESSAGE_TYPE_SHUTDOWN_REFUSE 14
107 119
108/** 120/**
109 * HELLO message used for communicating peer addresses. 121 * HELLO message used for communicating peer addresses.
diff --git a/src/include/gnunet_server_lib.h b/src/include/gnunet_server_lib.h
index 351c0a7c1..6d495c1c0 100644
--- a/src/include/gnunet_server_lib.h
+++ b/src/include/gnunet_server_lib.h
@@ -187,6 +187,15 @@ struct GNUNET_CONNECTION_TransmitHandle
187 187
188 188
189/** 189/**
190 * Set the persistent flag on this client, used to setup client connection
191 * to only be killed when the service it's connected to is actually dead.
192 *
193 * @param client the client to set the persistent flag on
194 */
195void
196GNUNET_SERVER_client_persist_ (struct GNUNET_SERVER_Client *client);
197
198/**
190 * Resume receiving from this client, we are done processing the 199 * Resume receiving from this client, we are done processing the
191 * current request. This function must be called from within each 200 * current request. This function must be called from within each
192 * GNUNET_SERVER_MessageCallback (or its respective continuations). 201 * GNUNET_SERVER_MessageCallback (or its respective continuations).
@@ -317,8 +326,9 @@ typedef int (*GNUNET_SERVER_CheckCallback) (void *cls);
317 * Destroy this connection (free resources). 326 * Destroy this connection (free resources).
318 * 327 *
319 * @param cls closure 328 * @param cls closure
329 * @pararm persist when connection is closed, "leak" socket
320 */ 330 */
321typedef void (*GNUNET_SERVER_DestroyCallback) (void *cls); 331typedef void (*GNUNET_SERVER_DestroyCallback) (void *cls, int persist);
322 332
323 333
324/** 334/**