Home | History | Annotate | Download | only in libevent

Lines Matching full:rpc

36  * This header files provides basic support for an RPC server and client.
38 * To support RPCs in a server, every supported RPC command needs to be
43 * SendCommand is the name of the RPC command.
45 * It contains all parameters relating to the SendCommand RPC. The
48 * contains the answer to the RPC.
50 * To register an RPC with an HTTP server, you need to first create an RPC
55 * A specific RPC can then be registered with
59 * when the server receives an appropriately formatted RPC, the user callback
62 * void FunctionCB(EVRPC_STRUCT(SendCommand)* rpc, void *arg);
64 * To send the reply, call EVRPC_REQUEST_DONE(rpc);
101 /* the callback invoked for each received rpc */
109 /** The type of a specific RPC Message
111 * @param rpcname the name of the RPC message
118 /* We alias the RPC specific structs to this voided one */
127 * the static structure for this rpc; that can be used to
130 struct evrpc *rpc;
138 * callback to reply and finish answering this rpc
140 void (*done)(struct evrpc_req_generic* rpc);
143 /** Creates the definitions and prototypes for an RPC
147 * defined in an .rpc file and converted to source code via event_rpcgen.py
149 * @param rpcname the name of the RPC
150 * @param reqstruct the name of the RPC request structure
151 * @param replystruct the name of the RPC reply structure
158 struct evrpc* rpc; \
161 struct evrpc* rpc, void *request, void *reply); \
169 /** Generates the code for receiving and sending an RPC message
172 * and receiving a particular RPC message
174 * @param rpcname the name of the RPC
175 * @param reqstruct the name of the RPC request structure
176 * @param replystruct the name of the RPC reply structure
214 /** Provides access to the HTTP request object underlying an RPC
219 * @param rpc_req the rpc request structure provided to the server callback
225 /** Creates the reply to an RPC request
231 * @param rpc_req the rpc request structure provided to the server callback
240 #define EVRPC_REGISTER_OBJECT(rpc, name, request, reply) \
242 (rpc)->uri = strdup(#name); \
243 if ((rpc)->uri == NULL) { \
247 (rpc)->request_new = (void *(*)(void))request##_new; \
248 (rpc)->request_free = (void (*)(void *))request##_free; \
249 (rpc)->request_unmarshal = (int (*)(void *, struct evbuffer *))request##_unmarshal; \
250 (rpc)->reply_new = (void *(*)(void))reply##_new; \
251 (rpc)->reply_free = (void (*)(void *))reply##_free; \
252 (rpc)->reply_complete = (int (*)(void *))reply##_complete; \
253 (rpc)->reply_marshal = (void (*)(struct evbuffer*, void *))reply##_marshal; \
259 /* functions to start up the rpc system */
261 /** Creates a new rpc base from which RPC requests can be received
281 * registers a new RPC with the HTTP server, each RPC needs to have
284 * @param base the evrpc_base structure in which the RPC should be
286 * @param name the name of the RPC
287 * @param request the name of the RPC request structure
288 * @param reply the name of the RPC reply structure
289 * @param callback the callback that should be invoked when the RPC
291 * void (*callback)(EVRPC_STRUCT(Message)* rpc, void *arg)
297 struct evrpc* rpc = (struct evrpc *)calloc(1, sizeof(struct evrpc)); \
298 EVRPC_REGISTER_OBJECT(rpc, name, request, reply); \
299 evrpc_register_rpc(base, rpc, \
307 * Unregisters an already registered RPC
309 * @param base the evrpc_base object from which to unregister an RPC
310 * @param name the name of the rpc to unregister
319 * Client-side RPC support
326 * provides information about the completed RPC request.
343 /* pool on which this rpc request is being made */
352 /* the name of the rpc */
372 /** launches an RPC and sends it to the server
374 * EVRPC_MAKE_REQUEST() is used by the client to send an RPC to the server.
376 * @param name the name of the RPC
379 * @param request a pointer to the RPC request structure - it contains the
381 * @param reply a pointer to the RPC reply structure. It is going to be filled
383 * @param cb the callback to invoke when the RPC request has been answered
392 /** creates an rpc connection pool
395 * rpc requests are always made via a pool.
403 /** frees an rpc connection pool
410 * adds a connection over which rpc can be dispatched. the connection
418 * RPC is completely aborted if it does not complete by then. Setting
452 /** adds a processing hook to either an rpc base or rpc pool