\hypertarget{rpc_8h}{\section{opal/mca/event/libevent2013/libevent/include/event2/rpc.h File Reference}
\label{rpc_8h}\index{opal/mca/event/libevent2013/libevent/include/event2/rpc.\+h@{opal/mca/event/libevent2013/libevent/include/event2/rpc.\+h}}
}


This header files provides basic support for an R\+P\+C server and client.  


\subsection*{Macros}
\begin{DoxyCompactItemize}
\item 
\#define \hyperlink{rpc_8h_a1a924e89c7a0c5eddc63cf9bf569fae6}{E\+V\+T\+A\+G\+\_\+\+H\+A\+S}(msg, member)~((msg)-\/$>$member\#\#\+\_\+set == 1)
\begin{DoxyCompactList}\small\item\em Determines if the member has been set in the message. \end{DoxyCompactList}\item 
\#define \hyperlink{rpc_8h_a8063c9f0927da79cc9e53600a77eecc6}{E\+V\+T\+A\+G\+\_\+\+A\+S\+S\+I\+G\+N}(msg, member, value)~($\ast$(msg)-\/$>$base-\/$>$member\#\#\+\_\+assign)((msg), (value))
\begin{DoxyCompactList}\small\item\em Assigns a value to the member in the message. \end{DoxyCompactList}\item 
\#define \hyperlink{rpc_8h_af420133e56a545bef6cba6f878d403d7}{E\+V\+T\+A\+G\+\_\+\+A\+S\+S\+I\+G\+N\+\_\+\+W\+I\+T\+H\+\_\+\+L\+E\+N}(msg, member, value, len)~($\ast$(msg)-\/$>$base-\/$>$member\#\#\+\_\+assign)((msg), (value), (len))
\begin{DoxyCompactList}\small\item\em Assigns a value to the member in the message. \end{DoxyCompactList}\item 
\#define \hyperlink{rpc_8h_aef6e54053208c090c43d05c9b2259fb9}{E\+V\+T\+A\+G\+\_\+\+G\+E\+T}(msg, member, pvalue)~($\ast$(msg)-\/$>$base-\/$>$member\#\#\+\_\+get)((msg), (pvalue))
\begin{DoxyCompactList}\small\item\em Returns the value for a member. \end{DoxyCompactList}\item 
\#define \hyperlink{rpc_8h_ae0b73ea41cb7f06976fd69a8f1be6219}{E\+V\+T\+A\+G\+\_\+\+G\+E\+T\+\_\+\+W\+I\+T\+H\+\_\+\+L\+E\+N}(msg, member, pvalue, plen)~($\ast$(msg)-\/$>$base-\/$>$member\#\#\+\_\+get)((msg), (pvalue), (plen))
\begin{DoxyCompactList}\small\item\em Returns the value for a member. \end{DoxyCompactList}\item 
\hypertarget{rpc_8h_a796d8c44ee666b13ecbae36b0897820b}{\#define \hyperlink{rpc_8h_a796d8c44ee666b13ecbae36b0897820b}{E\+V\+T\+A\+G\+\_\+\+A\+R\+R\+A\+Y\+\_\+\+A\+D\+D\+\_\+\+V\+A\+L\+U\+E}(msg, member, value)~($\ast$(msg)-\/$>$base-\/$>$member\#\#\+\_\+add)((msg), (value))}\label{rpc_8h_a796d8c44ee666b13ecbae36b0897820b}

\begin{DoxyCompactList}\small\item\em Adds a value to an array. \end{DoxyCompactList}\item 
\hypertarget{rpc_8h_a8bd4b0f338823bffee3ead3885ea6791}{\#define \hyperlink{rpc_8h_a8bd4b0f338823bffee3ead3885ea6791}{E\+V\+T\+A\+G\+\_\+\+A\+R\+R\+A\+Y\+\_\+\+A\+D\+D}(msg, member)~($\ast$(msg)-\/$>$base-\/$>$member\#\#\+\_\+add)(msg)}\label{rpc_8h_a8bd4b0f338823bffee3ead3885ea6791}

\begin{DoxyCompactList}\small\item\em Allocates a new entry in the array and returns it. \end{DoxyCompactList}\item 
\hypertarget{rpc_8h_a1b955ffe442d49fdfe17c76a6e758880}{\#define \hyperlink{rpc_8h_a1b955ffe442d49fdfe17c76a6e758880}{E\+V\+T\+A\+G\+\_\+\+A\+R\+R\+A\+Y\+\_\+\+G\+E\+T}(msg, member, offset, pvalue)~($\ast$(msg)-\/$>$base-\/$>$member\#\#\+\_\+get)((msg), (offset), (pvalue))}\label{rpc_8h_a1b955ffe442d49fdfe17c76a6e758880}

\begin{DoxyCompactList}\small\item\em Gets a variable at the specified offset from the array. \end{DoxyCompactList}\item 
\hypertarget{rpc_8h_ab4a0a6a9f8fbe20ced71eaebd297168b}{\#define \hyperlink{rpc_8h_ab4a0a6a9f8fbe20ced71eaebd297168b}{E\+V\+T\+A\+G\+\_\+\+A\+R\+R\+A\+Y\+\_\+\+L\+E\+N}(msg, member)~((msg)-\/$>$member\#\#\+\_\+length)}\label{rpc_8h_ab4a0a6a9f8fbe20ced71eaebd297168b}

\begin{DoxyCompactList}\small\item\em Returns the number of entries in the array. \end{DoxyCompactList}\item 
\#define \hyperlink{rpc_8h_ae9eff66229e154543551a936c59dd8fa}{E\+V\+R\+P\+C\+\_\+\+S\+T\+R\+U\+C\+T}(rpcname)~struct evrpc\+\_\+req\+\_\+\+\_\+\#\#rpcname
\begin{DoxyCompactList}\small\item\em The type of a specific R\+P\+C Message. \end{DoxyCompactList}\item 
\#define \hyperlink{rpc_8h_aa526799df545537b2dc67358b0dfaa15}{E\+V\+R\+P\+C\+\_\+\+H\+E\+A\+D\+E\+R}(rpcname, reqstruct, rplystruct)
\begin{DoxyCompactList}\small\item\em Creates the definitions and prototypes for an R\+P\+C. \end{DoxyCompactList}\item 
\#define \hyperlink{rpc_8h_ad7694fa8f1b5995a9d43bef1da170fad}{E\+V\+R\+P\+C\+\_\+\+M\+A\+K\+E\+\_\+\+C\+T\+X}(rpcname, reqstruct, rplystruct, pool, \hyperlink{structrequest}{request}, \hyperlink{structreply}{reply}, cb, cbarg)
\begin{DoxyCompactList}\small\item\em Creates a context structure that contains rpc specific information. \end{DoxyCompactList}\item 
\#define \hyperlink{rpc_8h_af7abcafae087e3c4dce6a4cd85346114}{E\+V\+R\+P\+C\+\_\+\+G\+E\+N\+E\+R\+A\+T\+E}(rpcname, reqstruct, rplystruct)
\begin{DoxyCompactList}\small\item\em Generates the code for receiving and sending an R\+P\+C message. \end{DoxyCompactList}\item 
\#define \hyperlink{rpc_8h_af78e1869994ee9597a9a0785d25fbf0b}{E\+V\+R\+P\+C\+\_\+\+R\+E\+Q\+U\+E\+S\+T\+\_\+\+H\+T\+T\+P}(rpc\+\_\+req)~(rpc\+\_\+req)-\/$>$http\+\_\+req
\begin{DoxyCompactList}\small\item\em Provides access to the H\+T\+T\+P request object underlying an R\+P\+C. \end{DoxyCompactList}\item 
\#define \hyperlink{rpc_8h_a36d6ba276baf3c95df69db35a2ef1527}{E\+V\+R\+P\+C\+\_\+\+R\+E\+Q\+U\+E\+S\+T\+\_\+\+D\+O\+N\+E}(rpc\+\_\+req)
\begin{DoxyCompactList}\small\item\em Creates the reply to an R\+P\+C request. \end{DoxyCompactList}\item 
\#define \hyperlink{rpc_8h_abb204281e2555a1e91ff3885747d0533}{E\+V\+R\+P\+C\+\_\+\+R\+E\+G\+I\+S\+T\+E\+R}(base, name, \hyperlink{structrequest}{request}, \hyperlink{structreply}{reply}, callback, cbarg)
\begin{DoxyCompactList}\small\item\em register R\+P\+Cs with the H\+T\+T\+P Server \end{DoxyCompactList}\item 
\#define \hyperlink{rpc_8h_ab646cdf50e026accddcd9fe23b35837b}{E\+V\+R\+P\+C\+\_\+\+U\+N\+R\+E\+G\+I\+S\+T\+E\+R}(base, name)~evrpc\+\_\+unregister\+\_\+rpc((base), \#name)
\begin{DoxyCompactList}\small\item\em Unregisters an already registered R\+P\+C. \end{DoxyCompactList}\item 
\#define \hyperlink{rpc_8h_aff0efcd7cb8b966256b5127960bd2c81}{E\+V\+R\+P\+C\+\_\+\+M\+A\+K\+E\+\_\+\+R\+E\+Q\+U\+E\+S\+T}(name, pool, \hyperlink{structrequest}{request}, \hyperlink{structreply}{reply}, cb, cbarg)~evrpc\+\_\+send\+\_\+request\+\_\+\#\#name((pool), (\hyperlink{structrequest}{request}), (\hyperlink{structreply}{reply}), (cb), (cbarg))
\begin{DoxyCompactList}\small\item\em launches an R\+P\+C and sends it to the server \end{DoxyCompactList}\item 
\#define \hyperlink{rpc_8h_a1bb283bd7893b9855e2f23013891fc82}{I\+N\+P\+U\+T}~\hyperlink{rpc_8h_a66eff7ea6bdd17e53fde6c4d9dc1835ba2a62d2e1147edb5b460c1abb17be9734}{E\+V\+R\+P\+C\+\_\+\+I\+N\+P\+U\+T}
\begin{DoxyCompactList}\small\item\em Deprecated alias for E\+V\+R\+P\+C\+\_\+\+I\+N\+P\+U\+T. \end{DoxyCompactList}\item 
\#define \hyperlink{rpc_8h_a61a3c9a18380aafb6e430e79bf596557}{O\+U\+T\+P\+U\+T}~\hyperlink{rpc_8h_a66eff7ea6bdd17e53fde6c4d9dc1835bad63587ff3a66808e422f1ca48c9db85e}{E\+V\+R\+P\+C\+\_\+\+O\+U\+T\+P\+U\+T}
\begin{DoxyCompactList}\small\item\em Deprecated alias for E\+V\+R\+P\+C\+\_\+\+O\+U\+T\+P\+U\+T. \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Enumerations}
\begin{DoxyCompactItemize}
\item 
enum \hyperlink{rpc_8h_a66eff7ea6bdd17e53fde6c4d9dc1835b}{E\+V\+R\+P\+C\+\_\+\+H\+O\+O\+K\+\_\+\+T\+Y\+P\+E} \{ \hyperlink{rpc_8h_a66eff7ea6bdd17e53fde6c4d9dc1835ba2a62d2e1147edb5b460c1abb17be9734}{E\+V\+R\+P\+C\+\_\+\+I\+N\+P\+U\+T}, 
\hyperlink{rpc_8h_a66eff7ea6bdd17e53fde6c4d9dc1835bad63587ff3a66808e422f1ca48c9db85e}{E\+V\+R\+P\+C\+\_\+\+O\+U\+T\+P\+U\+T}
 \}
\begin{DoxyCompactList}\small\item\em Hooks for changing the input and output of R\+P\+Cs; this can be used to implement compression, authentication, encryption, ... \end{DoxyCompactList}\item 
enum \hyperlink{rpc_8h_a9c37f133ebc96b2bd66c472079b1338b}{E\+V\+R\+P\+C\+\_\+\+H\+O\+O\+K\+\_\+\+R\+E\+S\+U\+L\+T} \{ \hyperlink{rpc_8h_a9c37f133ebc96b2bd66c472079b1338ba61de2cad490f408aa9ecc3427cfb6233}{E\+V\+R\+P\+C\+\_\+\+T\+E\+R\+M\+I\+N\+A\+T\+E} = -\/1, 
\hyperlink{rpc_8h_a9c37f133ebc96b2bd66c472079b1338ba4f92aee79d3413c4940eeb578ee33643}{E\+V\+R\+P\+C\+\_\+\+C\+O\+N\+T\+I\+N\+U\+E} = 0, 
\hyperlink{rpc_8h_a9c37f133ebc96b2bd66c472079b1338baff86ced7cf446eec75868ba64d956b9c}{E\+V\+R\+P\+C\+\_\+\+P\+A\+U\+S\+E} = 1
 \}
\begin{DoxyCompactList}\small\item\em Return value from hook processing functions. \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Functions}
\begin{DoxyCompactItemize}
\item 
\hypertarget{rpc_8h_a83b3d3ddadb971e808f5e37bc4eb61bc}{struct \hyperlink{structevrpc__request__wrapper}{evrpc\+\_\+request\+\_\+wrapper} $\ast$ \hyperlink{rpc_8h_a83b3d3ddadb971e808f5e37bc4eb61bc}{evrpc\+\_\+make\+\_\+request\+\_\+ctx} (struct \hyperlink{structevrpc__pool}{evrpc\+\_\+pool} $\ast$pool, void $\ast$\hyperlink{structrequest}{request}, void $\ast$\hyperlink{structreply}{reply}, const char $\ast$rpcname, void($\ast$req\+\_\+marshal)(struct \hyperlink{structevbuffer}{evbuffer} $\ast$, void $\ast$), void($\ast$rpl\+\_\+clear)(void $\ast$), int($\ast$rpl\+\_\+unmarshal)(void $\ast$, struct \hyperlink{structevbuffer}{evbuffer} $\ast$), void($\ast$cb)(struct \hyperlink{structevrpc__status}{evrpc\+\_\+status} $\ast$, void $\ast$, void $\ast$, void $\ast$), void $\ast$cbarg)}\label{rpc_8h_a83b3d3ddadb971e808f5e37bc4eb61bc}

\begin{DoxyCompactList}\small\item\em use E\+V\+R\+P\+C\+\_\+\+G\+E\+N\+E\+R\+A\+T\+E instead \end{DoxyCompactList}\item 
\hypertarget{rpc_8h_aa8538456a93ddcbdf55755b88994d09a}{void \hyperlink{rpc_8h_aa8538456a93ddcbdf55755b88994d09a}{evrpc\+\_\+request\+\_\+done} (struct \hyperlink{structevrpc__req__generic}{evrpc\+\_\+req\+\_\+generic} $\ast$req)}\label{rpc_8h_aa8538456a93ddcbdf55755b88994d09a}

\begin{DoxyCompactList}\small\item\em completes the server response to an rpc request \end{DoxyCompactList}\item 
\hypertarget{rpc_8h_afa6dddd447a86803d27a7b069503576c}{void $\ast$ \hyperlink{rpc_8h_afa6dddd447a86803d27a7b069503576c}{evrpc\+\_\+get\+\_\+request} (struct \hyperlink{structevrpc__req__generic}{evrpc\+\_\+req\+\_\+generic} $\ast$req)}\label{rpc_8h_afa6dddd447a86803d27a7b069503576c}

\begin{DoxyCompactList}\small\item\em accessors for request and reply \end{DoxyCompactList}\item 
\hypertarget{rpc_8h_a16119a6f8afcf3f3283e1a88bfa42262}{void $\ast$ {\bfseries evrpc\+\_\+get\+\_\+reply} (struct \hyperlink{structevrpc__req__generic}{evrpc\+\_\+req\+\_\+generic} $\ast$req)}\label{rpc_8h_a16119a6f8afcf3f3283e1a88bfa42262}

\item 
struct \hyperlink{structevrpc__base}{evrpc\+\_\+base} $\ast$ \hyperlink{rpc_8h_aca904025a4a1cb8d22164da3afe32b5a}{evrpc\+\_\+init} (struct \hyperlink{structevhttp}{evhttp} $\ast$server)
\begin{DoxyCompactList}\small\item\em Creates a new rpc base from which R\+P\+C requests can be received. \end{DoxyCompactList}\item 
void \hyperlink{rpc_8h_a64a8951f0d52f698a96808f276b32f39}{evrpc\+\_\+free} (struct \hyperlink{structevrpc__base}{evrpc\+\_\+base} $\ast$base)
\begin{DoxyCompactList}\small\item\em Frees the evrpc base. \end{DoxyCompactList}\item 
int \hyperlink{rpc_8h_abaa7d70da1d9fdcb767279b55944be65}{evrpc\+\_\+register\+\_\+rpc} (struct \hyperlink{structevrpc__base}{evrpc\+\_\+base} $\ast$, struct \hyperlink{structevrpc}{evrpc} $\ast$, void($\ast$)(struct \hyperlink{structevrpc__req__generic}{evrpc\+\_\+req\+\_\+generic} $\ast$, void $\ast$), void $\ast$)
\begin{DoxyCompactList}\small\item\em Low level function for registering an R\+P\+C with a server. \end{DoxyCompactList}\item 
\hypertarget{rpc_8h_a6b44b5ae7bad525a830eddfed03f561e}{int {\bfseries evrpc\+\_\+unregister\+\_\+rpc} (struct \hyperlink{structevrpc__base}{evrpc\+\_\+base} $\ast$base, const char $\ast$name)}\label{rpc_8h_a6b44b5ae7bad525a830eddfed03f561e}

\item 
int \hyperlink{rpc_8h_a1bc336c8cb4b87e77fd35c697420b3c5}{evrpc\+\_\+make\+\_\+request} (struct \hyperlink{structevrpc__request__wrapper}{evrpc\+\_\+request\+\_\+wrapper} $\ast$ctx)
\begin{DoxyCompactList}\small\item\em Makes an R\+P\+C request based on the provided context. \end{DoxyCompactList}\item 
struct \hyperlink{structevrpc__pool}{evrpc\+\_\+pool} $\ast$ \hyperlink{rpc_8h_a8e87434603994a71d26676ddfb1e2033}{evrpc\+\_\+pool\+\_\+new} (struct \hyperlink{structevent__base}{event\+\_\+base} $\ast$base)
\begin{DoxyCompactList}\small\item\em creates an rpc connection pool \end{DoxyCompactList}\item 
void \hyperlink{rpc_8h_a8d3e64475898ca58fd93b7f8919b3a01}{evrpc\+\_\+pool\+\_\+free} (struct \hyperlink{structevrpc__pool}{evrpc\+\_\+pool} $\ast$pool)
\begin{DoxyCompactList}\small\item\em frees an rpc connection pool \end{DoxyCompactList}\item 
void \hyperlink{rpc_8h_a063d8c73017ee732c8930e9c6fa00026}{evrpc\+\_\+pool\+\_\+add\+\_\+connection} (struct \hyperlink{structevrpc__pool}{evrpc\+\_\+pool} $\ast$pool, struct \hyperlink{structevhttp__connection}{evhttp\+\_\+connection} $\ast$evcon)
\begin{DoxyCompactList}\small\item\em Adds a connection over which rpc can be dispatched to the pool. \end{DoxyCompactList}\item 
void \hyperlink{rpc_8h_a707034fc4c7ba1021dd081863797e6e7}{evrpc\+\_\+pool\+\_\+remove\+\_\+connection} (struct \hyperlink{structevrpc__pool}{evrpc\+\_\+pool} $\ast$pool, struct \hyperlink{structevhttp__connection}{evhttp\+\_\+connection} $\ast$evcon)
\begin{DoxyCompactList}\small\item\em Removes a connection from the pool. \end{DoxyCompactList}\item 
void \hyperlink{rpc_8h_a17dae9e4a25a500e521baf5a2c1c5c0a}{evrpc\+\_\+pool\+\_\+set\+\_\+timeout} (struct \hyperlink{structevrpc__pool}{evrpc\+\_\+pool} $\ast$pool, int timeout\+\_\+in\+\_\+secs)
\begin{DoxyCompactList}\small\item\em Sets the timeout in secs after which a request has to complete. \end{DoxyCompactList}\item 
void $\ast$ \hyperlink{rpc_8h_adb188728ddbaf5c85ac9e98d9d11a4a4}{evrpc\+\_\+add\+\_\+hook} (void $\ast$vbase, enum \hyperlink{rpc_8h_a66eff7ea6bdd17e53fde6c4d9dc1835b}{E\+V\+R\+P\+C\+\_\+\+H\+O\+O\+K\+\_\+\+T\+Y\+P\+E} hook\+\_\+type, int($\ast$cb)(void $\ast$, struct \hyperlink{structevhttp__request}{evhttp\+\_\+request} $\ast$, struct \hyperlink{structevbuffer}{evbuffer} $\ast$, void $\ast$), void $\ast$cb\+\_\+arg)
\begin{DoxyCompactList}\small\item\em adds a processing hook to either an rpc base or rpc pool \end{DoxyCompactList}\item 
int \hyperlink{rpc_8h_a3969ea92840d165cab55a3228efcdbc6}{evrpc\+\_\+remove\+\_\+hook} (void $\ast$vbase, enum \hyperlink{rpc_8h_a66eff7ea6bdd17e53fde6c4d9dc1835b}{E\+V\+R\+P\+C\+\_\+\+H\+O\+O\+K\+\_\+\+T\+Y\+P\+E} hook\+\_\+type, void $\ast$handle)
\begin{DoxyCompactList}\small\item\em removes a previously added hook \end{DoxyCompactList}\item 
int \hyperlink{rpc_8h_a2724d98b6fc56d46cbfc9fe7ad9e6cf1}{evrpc\+\_\+resume\+\_\+request} (void $\ast$vbase, void $\ast$ctx, enum \hyperlink{rpc_8h_a9c37f133ebc96b2bd66c472079b1338b}{E\+V\+R\+P\+C\+\_\+\+H\+O\+O\+K\+\_\+\+R\+E\+S\+U\+L\+T} res)
\begin{DoxyCompactList}\small\item\em resume a paused request \end{DoxyCompactList}\item 
void \hyperlink{rpc_8h_a1e6e536a5c57a2d87ffe778746906626}{evrpc\+\_\+hook\+\_\+add\+\_\+meta} (void $\ast$ctx, const char $\ast$key, const void $\ast$data, size\+\_\+t data\+\_\+size)
\begin{DoxyCompactList}\small\item\em adds meta data to request \end{DoxyCompactList}\item 
int \hyperlink{rpc_8h_aad4ec382ca6789ac5bdc672420d98fc5}{evrpc\+\_\+hook\+\_\+find\+\_\+meta} (void $\ast$ctx, const char $\ast$key, void $\ast$$\ast$data, size\+\_\+t $\ast$data\+\_\+size)
\begin{DoxyCompactList}\small\item\em retrieves meta data previously associated \end{DoxyCompactList}\item 
struct \hyperlink{structevhttp__connection}{evhttp\+\_\+connection} $\ast$ \hyperlink{rpc_8h_a3aef04ab91e1af62675cd7d76fd06e94}{evrpc\+\_\+hook\+\_\+get\+\_\+connection} (void $\ast$ctx)
\begin{DoxyCompactList}\small\item\em returns the connection object associated with the request \end{DoxyCompactList}\item 
int \hyperlink{rpc_8h_a3d0c80cbf69003059bcdef4bfdbb321f}{evrpc\+\_\+send\+\_\+request\+\_\+generic} (struct \hyperlink{structevrpc__pool}{evrpc\+\_\+pool} $\ast$pool, void $\ast$\hyperlink{structrequest}{request}, void $\ast$\hyperlink{structreply}{reply}, void($\ast$cb)(struct \hyperlink{structevrpc__status}{evrpc\+\_\+status} $\ast$, void $\ast$, void $\ast$, void $\ast$), void $\ast$cb\+\_\+arg, const char $\ast$rpcname, void($\ast$req\+\_\+marshal)(struct \hyperlink{structevbuffer}{evbuffer} $\ast$, void $\ast$), void($\ast$rpl\+\_\+clear)(void $\ast$), int($\ast$rpl\+\_\+unmarshal)(void $\ast$, struct \hyperlink{structevbuffer}{evbuffer} $\ast$))
\begin{DoxyCompactList}\small\item\em \hyperlink{structFunction}{Function} for sending a generic R\+P\+C request. \end{DoxyCompactList}\item 
int \hyperlink{rpc_8h_a5987c57760de0cfb2639e36406ae99d8}{evrpc\+\_\+register\+\_\+generic} (struct \hyperlink{structevrpc__base}{evrpc\+\_\+base} $\ast$base, const char $\ast$name, void($\ast$callback)(struct \hyperlink{structevrpc__req__generic}{evrpc\+\_\+req\+\_\+generic} $\ast$, void $\ast$), void $\ast$cbarg, void $\ast$($\ast$req\+\_\+new)(void $\ast$), void $\ast$req\+\_\+new\+\_\+arg, void($\ast$req\+\_\+free)(void $\ast$), int($\ast$req\+\_\+unmarshal)(void $\ast$, struct \hyperlink{structevbuffer}{evbuffer} $\ast$), void $\ast$($\ast$rpl\+\_\+new)(void $\ast$), void $\ast$rpl\+\_\+new\+\_\+arg, void($\ast$rpl\+\_\+free)(void $\ast$), int($\ast$rpl\+\_\+complete)(void $\ast$), void($\ast$rpl\+\_\+marshal)(struct \hyperlink{structevbuffer}{evbuffer} $\ast$, void $\ast$))
\begin{DoxyCompactList}\small\item\em \hyperlink{structFunction}{Function} for registering a generic R\+P\+C with the R\+P\+C base. \end{DoxyCompactList}\item 
\hypertarget{rpc_8h_ab61cc3e97056faa013c3ad612e4ae763}{struct \hyperlink{structevrpc__pool}{evrpc\+\_\+pool} $\ast$ \hyperlink{rpc_8h_ab61cc3e97056faa013c3ad612e4ae763}{evrpc\+\_\+request\+\_\+get\+\_\+pool} (struct \hyperlink{structevrpc__request__wrapper}{evrpc\+\_\+request\+\_\+wrapper} $\ast$ctx)}\label{rpc_8h_ab61cc3e97056faa013c3ad612e4ae763}

\begin{DoxyCompactList}\small\item\em accessors for obscure and undocumented functionality \end{DoxyCompactList}\item 
\hypertarget{rpc_8h_a21f7067fdc8d9328b28badb5c1c4016d}{void {\bfseries evrpc\+\_\+request\+\_\+set\+\_\+pool} (struct \hyperlink{structevrpc__request__wrapper}{evrpc\+\_\+request\+\_\+wrapper} $\ast$ctx, struct \hyperlink{structevrpc__pool}{evrpc\+\_\+pool} $\ast$pool)}\label{rpc_8h_a21f7067fdc8d9328b28badb5c1c4016d}

\item 
\hypertarget{rpc_8h_a53cb59f6f7da1781221ac1aed2ddc38d}{void {\bfseries evrpc\+\_\+request\+\_\+set\+\_\+cb} (struct \hyperlink{structevrpc__request__wrapper}{evrpc\+\_\+request\+\_\+wrapper} $\ast$ctx, void($\ast$cb)(struct \hyperlink{structevrpc__status}{evrpc\+\_\+status} $\ast$, void $\ast$\hyperlink{structrequest}{request}, void $\ast$\hyperlink{structreply}{reply}, void $\ast$arg), void $\ast$cb\+\_\+arg)}\label{rpc_8h_a53cb59f6f7da1781221ac1aed2ddc38d}

\end{DoxyCompactItemize}


\subsection{Detailed Description}
This header files provides basic support for an R\+P\+C server and client. 

To support R\+P\+Cs in a server, every supported R\+P\+C command needs to be defined and registered.

\hyperlink{rpc_8h_aa526799df545537b2dc67358b0dfaa15}{E\+V\+R\+P\+C\+\_\+\+H\+E\+A\+D\+E\+R(\+Send\+Command, Request, Reply)};

Send\+Command is the name of the R\+P\+C command. \hyperlink{classRequest}{Request} is the name of a structure generated by event\+\_\+rpcgen.\+py. It contains all parameters relating to the Send\+Command R\+P\+C. The server needs to fill in the Reply structure. Reply is the name of a structure generated by event\+\_\+rpcgen.\+py. It contains the answer to the R\+P\+C.

To register an R\+P\+C with an H\+T\+T\+P server, you need to first create an R\+P\+C base with\+:

struct \hyperlink{structevrpc__base}{evrpc\+\_\+base} $\ast$base = evrpc\+\_\+init(http);

A specific R\+P\+C can then be registered with

\hyperlink{rpc_8h_abb204281e2555a1e91ff3885747d0533}{E\+V\+R\+P\+C\+\_\+\+R\+E\+G\+I\+S\+T\+E\+R(base, Send\+Command, Request, Reply,  Function\+C\+B, arg)};

when the server receives an appropriately formatted R\+P\+C, the user callback is invoked. The callback needs to fill in the reply structure.

void Function\+C\+B(\+E\+V\+R\+P\+C\+\_\+\+S\+T\+R\+U\+C\+T(\+Send\+Command)$\ast$ rpc, void $\ast$arg);

To send the reply, call \hyperlink{rpc_8h_a36d6ba276baf3c95df69db35a2ef1527}{E\+V\+R\+P\+C\+\_\+\+R\+E\+Q\+U\+E\+S\+T\+\_\+\+D\+O\+N\+E(rpc)};

See the regression test for an example. 

\subsection{Macro Definition Documentation}
\hypertarget{rpc_8h_af7abcafae087e3c4dce6a4cd85346114}{\index{rpc.\+h@{rpc.\+h}!E\+V\+R\+P\+C\+\_\+\+G\+E\+N\+E\+R\+A\+T\+E@{E\+V\+R\+P\+C\+\_\+\+G\+E\+N\+E\+R\+A\+T\+E}}
\index{E\+V\+R\+P\+C\+\_\+\+G\+E\+N\+E\+R\+A\+T\+E@{E\+V\+R\+P\+C\+\_\+\+G\+E\+N\+E\+R\+A\+T\+E}!rpc.\+h@{rpc.\+h}}
\subsubsection[{E\+V\+R\+P\+C\+\_\+\+G\+E\+N\+E\+R\+A\+T\+E}]{\setlength{\rightskip}{0pt plus 5cm}\#define E\+V\+R\+P\+C\+\_\+\+G\+E\+N\+E\+R\+A\+T\+E(
\begin{DoxyParamCaption}
\item[{}]{rpcname, }
\item[{}]{reqstruct, }
\item[{}]{rplystruct}
\end{DoxyParamCaption}
)}}\label{rpc_8h_af7abcafae087e3c4dce6a4cd85346114}
{\bfseries Value\+:}
\begin{DoxyCode}
\textcolor{keywordtype}{int} evrpc\_send\_request\_##rpcname(\textcolor{keyword}{struct} \hyperlink{structevrpc__pool}{evrpc\_pool} *pool,     \(\backslash\)
            \textcolor{keyword}{struct} reqstruct *\hyperlink{structrequest}{request}, \textcolor{keyword}{struct} rplystruct *\hyperlink{structreply}{reply},    \(\backslash\)
            \textcolor{keywordtype}{void} (*cb)(\textcolor{keyword}{struct} \hyperlink{structevrpc__status}{evrpc\_status} *,                               \(\backslash\)
                \textcolor{keyword}{struct} reqstruct *, \textcolor{keyword}{struct} rplystruct *, \textcolor{keywordtype}{void} *cbarg),  \(\backslash\)
            \textcolor{keywordtype}{void} *cbarg) \{                                              \(\backslash\)
        return \hyperlink{rpc_8h_a3d0c80cbf69003059bcdef4bfdbb321f}{evrpc\_send\_request\_generic}(pool, request, reply,       \(\backslash\)
            (\textcolor{keywordtype}{void} (*)(\textcolor{keyword}{struct} \hyperlink{structevrpc__status}{evrpc\_status} *, \textcolor{keywordtype}{void} *, \textcolor{keywordtype}{void} *, \textcolor{keywordtype}{void} *))cb, \(\backslash\)
            cbarg,                                                      \(\backslash\)
            #rpcname,                                                   \(\backslash\)
            (\textcolor{keywordtype}{void} (*)(\textcolor{keyword}{struct} \hyperlink{structevbuffer}{evbuffer} *, \textcolor{keywordtype}{void} *))reqstruct##\_marshal,   \(\backslash\)
            (\textcolor{keywordtype}{void} (*)(\textcolor{keywordtype}{void} *))rplystruct##\_clear,                       \(\backslash\)
            (\textcolor{keywordtype}{int} (*)(\textcolor{keywordtype}{void} *, \textcolor{keyword}{struct} \hyperlink{structevbuffer}{evbuffer} *))rplystruct##\_unmarshal); \(\backslash\)
\}
\end{DoxyCode}


Generates the code for receiving and sending an R\+P\+C message. 

E\+V\+R\+P\+C\+\_\+\+G\+E\+N\+E\+R\+A\+T\+E is used to create the code corresponding to sending and receiving a particular R\+P\+C message


\begin{DoxyParams}{Parameters}
{\em rpcname} & the name of the R\+P\+C \\
\hline
{\em reqstruct} & the name of the R\+P\+C request structure \\
\hline
{\em replystruct} & the name of the R\+P\+C reply structure \\
\hline
\end{DoxyParams}
\begin{DoxySeeAlso}{See also}
\hyperlink{rpc_8h_aa526799df545537b2dc67358b0dfaa15}{E\+V\+R\+P\+C\+\_\+\+H\+E\+A\+D\+E\+R()} 
\end{DoxySeeAlso}
\hypertarget{rpc_8h_aa526799df545537b2dc67358b0dfaa15}{\index{rpc.\+h@{rpc.\+h}!E\+V\+R\+P\+C\+\_\+\+H\+E\+A\+D\+E\+R@{E\+V\+R\+P\+C\+\_\+\+H\+E\+A\+D\+E\+R}}
\index{E\+V\+R\+P\+C\+\_\+\+H\+E\+A\+D\+E\+R@{E\+V\+R\+P\+C\+\_\+\+H\+E\+A\+D\+E\+R}!rpc.\+h@{rpc.\+h}}
\subsubsection[{E\+V\+R\+P\+C\+\_\+\+H\+E\+A\+D\+E\+R}]{\setlength{\rightskip}{0pt plus 5cm}\#define E\+V\+R\+P\+C\+\_\+\+H\+E\+A\+D\+E\+R(
\begin{DoxyParamCaption}
\item[{}]{rpcname, }
\item[{}]{reqstruct, }
\item[{}]{rplystruct}
\end{DoxyParamCaption}
)}}\label{rpc_8h_aa526799df545537b2dc67358b0dfaa15}
{\bfseries Value\+:}
\begin{DoxyCode}
\hyperlink{rpc_8h_ae9eff66229e154543551a936c59dd8fa}{EVRPC\_STRUCT}(rpcname) \{     \(\backslash\)
        struct \hyperlink{structevrpc__hook__meta}{evrpc\_hook\_meta} *hook\_meta; \(\backslash\)
        struct reqstruct* \hyperlink{structrequest}{request}; \(\backslash\)
        struct rplystruct* \hyperlink{structreply}{reply}; \(\backslash\)
        struct \hyperlink{structevrpc}{evrpc}* rpc; \(\backslash\)
        struct \hyperlink{structevhttp__request}{evhttp\_request}* http\_req; \(\backslash\)
        struct \hyperlink{structevbuffer}{evbuffer}* rpc\_data; \(\backslash\)
\};                                                                   \(\backslash\)
int evrpc\_send\_request\_##rpcname(\textcolor{keyword}{struct} \hyperlink{structevrpc__pool}{evrpc\_pool} *, \(\backslash\)
    \textcolor{keyword}{struct} reqstruct *, \textcolor{keyword}{struct} rplystruct *, \(\backslash\)
    \textcolor{keywordtype}{void} (*)(\textcolor{keyword}{struct} \hyperlink{structevrpc__status}{evrpc\_status} *, \(\backslash\)
        \textcolor{keyword}{struct} reqstruct *, \textcolor{keyword}{struct} rplystruct *, \textcolor{keywordtype}{void} *cbarg),  \(\backslash\)
    \textcolor{keywordtype}{void} *);
\end{DoxyCode}


Creates the definitions and prototypes for an R\+P\+C. 

You need to use E\+V\+R\+P\+C\+\_\+\+H\+E\+A\+D\+E\+R to create structures and function prototypes needed by the server and client implementation. The structures have to be defined in an .rpc file and converted to source code via event\+\_\+rpcgen.\+py


\begin{DoxyParams}{Parameters}
{\em rpcname} & the name of the R\+P\+C \\
\hline
{\em reqstruct} & the name of the R\+P\+C request structure \\
\hline
{\em replystruct} & the name of the R\+P\+C reply structure \\
\hline
\end{DoxyParams}
\begin{DoxySeeAlso}{See also}
\hyperlink{rpc_8h_af7abcafae087e3c4dce6a4cd85346114}{E\+V\+R\+P\+C\+\_\+\+G\+E\+N\+E\+R\+A\+T\+E()} 
\end{DoxySeeAlso}
\hypertarget{rpc_8h_ad7694fa8f1b5995a9d43bef1da170fad}{\index{rpc.\+h@{rpc.\+h}!E\+V\+R\+P\+C\+\_\+\+M\+A\+K\+E\+\_\+\+C\+T\+X@{E\+V\+R\+P\+C\+\_\+\+M\+A\+K\+E\+\_\+\+C\+T\+X}}
\index{E\+V\+R\+P\+C\+\_\+\+M\+A\+K\+E\+\_\+\+C\+T\+X@{E\+V\+R\+P\+C\+\_\+\+M\+A\+K\+E\+\_\+\+C\+T\+X}!rpc.\+h@{rpc.\+h}}
\subsubsection[{E\+V\+R\+P\+C\+\_\+\+M\+A\+K\+E\+\_\+\+C\+T\+X}]{\setlength{\rightskip}{0pt plus 5cm}\#define E\+V\+R\+P\+C\+\_\+\+M\+A\+K\+E\+\_\+\+C\+T\+X(
\begin{DoxyParamCaption}
\item[{}]{rpcname, }
\item[{}]{reqstruct, }
\item[{}]{rplystruct, }
\item[{}]{pool, }
\item[{}]{{\bf request}, }
\item[{}]{{\bf reply}, }
\item[{}]{cb, }
\item[{}]{cbarg}
\end{DoxyParamCaption}
)}}\label{rpc_8h_ad7694fa8f1b5995a9d43bef1da170fad}
{\bfseries Value\+:}
\begin{DoxyCode}
\hyperlink{rpc_8h_a83b3d3ddadb971e808f5e37bc4eb61bc}{evrpc\_make\_request\_ctx}(pool, \hyperlink{structrequest}{request}, \hyperlink{structreply}{reply},                  \(\backslash\)
            #rpcname,                                                   \(\backslash\)
            (\textcolor{keywordtype}{void} (*)(\textcolor{keyword}{struct} \hyperlink{structevbuffer}{evbuffer} *, \textcolor{keywordtype}{void} *))reqstruct##\_marshal,   \(\backslash\)
            (\textcolor{keywordtype}{void} (*)(\textcolor{keywordtype}{void} *))rplystruct##\_clear,                       \(\backslash\)
            (\textcolor{keywordtype}{int} (*)(\textcolor{keywordtype}{void} *, \textcolor{keyword}{struct} \hyperlink{structevbuffer}{evbuffer} *))rplystruct##\_unmarshal, \(\backslash\)
            (\textcolor{keywordtype}{void} (*)(\textcolor{keyword}{struct} \hyperlink{structevrpc__status}{evrpc\_status} *, \textcolor{keywordtype}{void} *, \textcolor{keywordtype}{void} *, \textcolor{keywordtype}{void} *))cb, \(\backslash\)
            cbarg)
\end{DoxyCode}


Creates a context structure that contains rpc specific information. 

E\+V\+R\+P\+C\+\_\+\+M\+A\+K\+E\+\_\+\+C\+T\+X is used to populate a R\+P\+C specific context that contains information about marshaling the R\+P\+C data types.


\begin{DoxyParams}{Parameters}
{\em rpcname} & the name of the R\+P\+C \\
\hline
{\em reqstruct} & the name of the R\+P\+C request structure \\
\hline
{\em replystruct} & the name of the R\+P\+C reply structure \\
\hline
{\em pool} & the \hyperlink{structevrpc__pool}{evrpc\+\_\+pool} over which to make the request \\
\hline
{\em request} & a pointer to the R\+P\+C request structure object \\
\hline
{\em reply} & a pointer to the R\+P\+C reply structure object \\
\hline
{\em cb} & the callback function to call when the R\+P\+C has completed \\
\hline
{\em cbarg} & the argument to supply to the callback \\
\hline
\end{DoxyParams}
\hypertarget{rpc_8h_aff0efcd7cb8b966256b5127960bd2c81}{\index{rpc.\+h@{rpc.\+h}!E\+V\+R\+P\+C\+\_\+\+M\+A\+K\+E\+\_\+\+R\+E\+Q\+U\+E\+S\+T@{E\+V\+R\+P\+C\+\_\+\+M\+A\+K\+E\+\_\+\+R\+E\+Q\+U\+E\+S\+T}}
\index{E\+V\+R\+P\+C\+\_\+\+M\+A\+K\+E\+\_\+\+R\+E\+Q\+U\+E\+S\+T@{E\+V\+R\+P\+C\+\_\+\+M\+A\+K\+E\+\_\+\+R\+E\+Q\+U\+E\+S\+T}!rpc.\+h@{rpc.\+h}}
\subsubsection[{E\+V\+R\+P\+C\+\_\+\+M\+A\+K\+E\+\_\+\+R\+E\+Q\+U\+E\+S\+T}]{\setlength{\rightskip}{0pt plus 5cm}\#define E\+V\+R\+P\+C\+\_\+\+M\+A\+K\+E\+\_\+\+R\+E\+Q\+U\+E\+S\+T(
\begin{DoxyParamCaption}
\item[{}]{name, }
\item[{}]{pool, }
\item[{}]{{\bf request}, }
\item[{}]{{\bf reply}, }
\item[{}]{cb, }
\item[{}]{cbarg}
\end{DoxyParamCaption}
)~evrpc\+\_\+send\+\_\+request\+\_\+\#\#name((pool), ({\bf request}), ({\bf reply}), (cb), (cbarg))}}\label{rpc_8h_aff0efcd7cb8b966256b5127960bd2c81}


launches an R\+P\+C and sends it to the server 

\hyperlink{rpc_8h_aff0efcd7cb8b966256b5127960bd2c81}{E\+V\+R\+P\+C\+\_\+\+M\+A\+K\+E\+\_\+\+R\+E\+Q\+U\+E\+S\+T()} is used by the client to send an R\+P\+C to the server.


\begin{DoxyParams}{Parameters}
{\em name} & the name of the R\+P\+C \\
\hline
{\em pool} & the \hyperlink{structevrpc__pool}{evrpc\+\_\+pool} that contains the connection objects over which the request should be sent. \\
\hline
{\em request} & a pointer to the R\+P\+C request structure -\/ it contains the data to be sent to the server. \\
\hline
{\em reply} & a pointer to the R\+P\+C reply structure. It is going to be filled if the request was answered successfully \\
\hline
{\em cb} & the callback to invoke when the R\+P\+C request has been answered \\
\hline
{\em cbarg} & an additional argument to be passed to the client \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
0 on success, -\/1 on failure 
\end{DoxyReturn}
\hypertarget{rpc_8h_abb204281e2555a1e91ff3885747d0533}{\index{rpc.\+h@{rpc.\+h}!E\+V\+R\+P\+C\+\_\+\+R\+E\+G\+I\+S\+T\+E\+R@{E\+V\+R\+P\+C\+\_\+\+R\+E\+G\+I\+S\+T\+E\+R}}
\index{E\+V\+R\+P\+C\+\_\+\+R\+E\+G\+I\+S\+T\+E\+R@{E\+V\+R\+P\+C\+\_\+\+R\+E\+G\+I\+S\+T\+E\+R}!rpc.\+h@{rpc.\+h}}
\subsubsection[{E\+V\+R\+P\+C\+\_\+\+R\+E\+G\+I\+S\+T\+E\+R}]{\setlength{\rightskip}{0pt plus 5cm}\#define E\+V\+R\+P\+C\+\_\+\+R\+E\+G\+I\+S\+T\+E\+R(
\begin{DoxyParamCaption}
\item[{}]{base, }
\item[{}]{name, }
\item[{}]{{\bf request}, }
\item[{}]{{\bf reply}, }
\item[{}]{callback, }
\item[{}]{cbarg}
\end{DoxyParamCaption}
)}}\label{rpc_8h_abb204281e2555a1e91ff3885747d0533}
{\bfseries Value\+:}
\begin{DoxyCode}
\hyperlink{rpc_8h_a5987c57760de0cfb2639e36406ae99d8}{evrpc\_register\_generic}(base, #name,                               \(\backslash\)
            (\textcolor{keywordtype}{void} (*)(\textcolor{keyword}{struct} \hyperlink{structevrpc__req__generic}{evrpc\_req\_generic} *, \textcolor{keywordtype}{void} *))callback, cbarg, \(\backslash\)
            (\textcolor{keywordtype}{void} *(*)(\textcolor{keywordtype}{void} *))\hyperlink{structrequest}{request}##\_new, NULL,                      \(\backslash\)
            (\textcolor{keywordtype}{void} (*)(\textcolor{keywordtype}{void} *))\hyperlink{structrequest}{request}##\_free,                            \(\backslash\)
            (\textcolor{keywordtype}{int} (*)(\textcolor{keywordtype}{void} *, \textcolor{keyword}{struct} \hyperlink{structevbuffer}{evbuffer} *))\hyperlink{structrequest}{request}##\_unmarshal,     \(\backslash\)
            (\textcolor{keywordtype}{void} *(*)(\textcolor{keywordtype}{void} *))\hyperlink{structreply}{reply}##\_new, NULL,                  \(\backslash\)
            (\textcolor{keywordtype}{void} (*)(\textcolor{keywordtype}{void} *))\hyperlink{structreply}{reply}##\_free, \(\backslash\)
            (\textcolor{keywordtype}{int} (*)(\textcolor{keywordtype}{void} *))\hyperlink{structreply}{reply}##\_complete, \(\backslash\)
            (\textcolor{keywordtype}{void} (*)(\textcolor{keyword}{struct} \hyperlink{structevbuffer}{evbuffer} *, \textcolor{keywordtype}{void} *))\hyperlink{structreply}{reply}##\_marshal)
\end{DoxyCode}


register R\+P\+Cs with the H\+T\+T\+P Server 

registers a new R\+P\+C with the H\+T\+T\+P server, each R\+P\+C needs to have a unique name under which it can be identified.


\begin{DoxyParams}{Parameters}
{\em base} & the \hyperlink{structevrpc__base}{evrpc\+\_\+base} structure in which the R\+P\+C should be registered. \\
\hline
{\em name} & the name of the R\+P\+C \\
\hline
{\em request} & the name of the R\+P\+C request structure \\
\hline
{\em reply} & the name of the R\+P\+C reply structure \\
\hline
{\em callback} & the callback that should be invoked when the R\+P\+C is received. The callback has the following prototype void ({\itshape callback)(\hyperlink{rpc_8h_ae9eff66229e154543551a936c59dd8fa}{E\+V\+R\+P\+C\+\_\+\+S\+T\+R\+U\+C\+T(\+Message)}} rpc, void $\ast$arg) \\
\hline
{\em cbarg} & an additional parameter that can be passed to the callback. The parameter can be used to carry around state. \\
\hline
\end{DoxyParams}
\hypertarget{rpc_8h_a36d6ba276baf3c95df69db35a2ef1527}{\index{rpc.\+h@{rpc.\+h}!E\+V\+R\+P\+C\+\_\+\+R\+E\+Q\+U\+E\+S\+T\+\_\+\+D\+O\+N\+E@{E\+V\+R\+P\+C\+\_\+\+R\+E\+Q\+U\+E\+S\+T\+\_\+\+D\+O\+N\+E}}
\index{E\+V\+R\+P\+C\+\_\+\+R\+E\+Q\+U\+E\+S\+T\+\_\+\+D\+O\+N\+E@{E\+V\+R\+P\+C\+\_\+\+R\+E\+Q\+U\+E\+S\+T\+\_\+\+D\+O\+N\+E}!rpc.\+h@{rpc.\+h}}
\subsubsection[{E\+V\+R\+P\+C\+\_\+\+R\+E\+Q\+U\+E\+S\+T\+\_\+\+D\+O\+N\+E}]{\setlength{\rightskip}{0pt plus 5cm}\#define E\+V\+R\+P\+C\+\_\+\+R\+E\+Q\+U\+E\+S\+T\+\_\+\+D\+O\+N\+E(
\begin{DoxyParamCaption}
\item[{}]{rpc\+\_\+req}
\end{DoxyParamCaption}
)}}\label{rpc_8h_a36d6ba276baf3c95df69db35a2ef1527}
{\bfseries Value\+:}
\begin{DoxyCode}
\textcolor{keywordflow}{do} \{ \(\backslash\)
  struct \hyperlink{structevrpc__req__generic}{evrpc\_req\_generic} *\_req = (\textcolor{keyword}{struct }\hyperlink{structevrpc__req__generic}{evrpc\_req\_generic} *)(rpc\_req);
       \hyperlink{rpc_8h_aa8538456a93ddcbdf55755b88994d09a}{\(\backslash\)}
\hyperlink{rpc_8h_aa8538456a93ddcbdf55755b88994d09a}{  evrpc\_request\_done}(\_req);                                 \(\backslash\)
\} \textcolor{keywordflow}{while} (0)
\end{DoxyCode}


Creates the reply to an R\+P\+C request. 

E\+V\+R\+P\+C\+\_\+\+R\+E\+Q\+U\+E\+S\+T\+\_\+\+D\+O\+N\+E is used to answer a request; the reply is expected to have been filled in. The request and reply pointers become invalid after this call has finished.


\begin{DoxyParams}{Parameters}
{\em rpc\+\_\+req} & the rpc request structure provided to the server callback \\
\hline
\end{DoxyParams}
\hypertarget{rpc_8h_af78e1869994ee9597a9a0785d25fbf0b}{\index{rpc.\+h@{rpc.\+h}!E\+V\+R\+P\+C\+\_\+\+R\+E\+Q\+U\+E\+S\+T\+\_\+\+H\+T\+T\+P@{E\+V\+R\+P\+C\+\_\+\+R\+E\+Q\+U\+E\+S\+T\+\_\+\+H\+T\+T\+P}}
\index{E\+V\+R\+P\+C\+\_\+\+R\+E\+Q\+U\+E\+S\+T\+\_\+\+H\+T\+T\+P@{E\+V\+R\+P\+C\+\_\+\+R\+E\+Q\+U\+E\+S\+T\+\_\+\+H\+T\+T\+P}!rpc.\+h@{rpc.\+h}}
\subsubsection[{E\+V\+R\+P\+C\+\_\+\+R\+E\+Q\+U\+E\+S\+T\+\_\+\+H\+T\+T\+P}]{\setlength{\rightskip}{0pt plus 5cm}\#define E\+V\+R\+P\+C\+\_\+\+R\+E\+Q\+U\+E\+S\+T\+\_\+\+H\+T\+T\+P(
\begin{DoxyParamCaption}
\item[{}]{rpc\+\_\+req}
\end{DoxyParamCaption}
)~(rpc\+\_\+req)-\/$>$http\+\_\+req}}\label{rpc_8h_af78e1869994ee9597a9a0785d25fbf0b}


Provides access to the H\+T\+T\+P request object underlying an R\+P\+C. 

Access to the underlying http object; can be used to look at headers or for getting the remote ip address


\begin{DoxyParams}{Parameters}
{\em rpc\+\_\+req} & the rpc request structure provided to the server callback \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
an struct \hyperlink{structevhttp__request}{evhttp\+\_\+request} object that can be inspected for H\+T\+T\+P headers or sender information. 
\end{DoxyReturn}
\hypertarget{rpc_8h_ae9eff66229e154543551a936c59dd8fa}{\index{rpc.\+h@{rpc.\+h}!E\+V\+R\+P\+C\+\_\+\+S\+T\+R\+U\+C\+T@{E\+V\+R\+P\+C\+\_\+\+S\+T\+R\+U\+C\+T}}
\index{E\+V\+R\+P\+C\+\_\+\+S\+T\+R\+U\+C\+T@{E\+V\+R\+P\+C\+\_\+\+S\+T\+R\+U\+C\+T}!rpc.\+h@{rpc.\+h}}
\subsubsection[{E\+V\+R\+P\+C\+\_\+\+S\+T\+R\+U\+C\+T}]{\setlength{\rightskip}{0pt plus 5cm}\#define E\+V\+R\+P\+C\+\_\+\+S\+T\+R\+U\+C\+T(
\begin{DoxyParamCaption}
\item[{}]{rpcname}
\end{DoxyParamCaption}
)~struct evrpc\+\_\+req\+\_\+\+\_\+\#\#rpcname}}\label{rpc_8h_ae9eff66229e154543551a936c59dd8fa}


The type of a specific R\+P\+C Message. 


\begin{DoxyParams}{Parameters}
{\em rpcname} & the name of the R\+P\+C message \\
\hline
\end{DoxyParams}
\hypertarget{rpc_8h_ab646cdf50e026accddcd9fe23b35837b}{\index{rpc.\+h@{rpc.\+h}!E\+V\+R\+P\+C\+\_\+\+U\+N\+R\+E\+G\+I\+S\+T\+E\+R@{E\+V\+R\+P\+C\+\_\+\+U\+N\+R\+E\+G\+I\+S\+T\+E\+R}}
\index{E\+V\+R\+P\+C\+\_\+\+U\+N\+R\+E\+G\+I\+S\+T\+E\+R@{E\+V\+R\+P\+C\+\_\+\+U\+N\+R\+E\+G\+I\+S\+T\+E\+R}!rpc.\+h@{rpc.\+h}}
\subsubsection[{E\+V\+R\+P\+C\+\_\+\+U\+N\+R\+E\+G\+I\+S\+T\+E\+R}]{\setlength{\rightskip}{0pt plus 5cm}\#define E\+V\+R\+P\+C\+\_\+\+U\+N\+R\+E\+G\+I\+S\+T\+E\+R(
\begin{DoxyParamCaption}
\item[{}]{base, }
\item[{}]{name}
\end{DoxyParamCaption}
)~evrpc\+\_\+unregister\+\_\+rpc((base), \#name)}}\label{rpc_8h_ab646cdf50e026accddcd9fe23b35837b}


Unregisters an already registered R\+P\+C. 


\begin{DoxyParams}{Parameters}
{\em base} & the \hyperlink{structevrpc__base}{evrpc\+\_\+base} object from which to unregister an R\+P\+C \\
\hline
{\em name} & the name of the rpc to unregister \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
-\/1 on error or 0 when successful. 
\end{DoxyReturn}
\begin{DoxySeeAlso}{See also}
\hyperlink{rpc_8h_abb204281e2555a1e91ff3885747d0533}{E\+V\+R\+P\+C\+\_\+\+R\+E\+G\+I\+S\+T\+E\+R()} 
\end{DoxySeeAlso}
\hypertarget{rpc_8h_a8063c9f0927da79cc9e53600a77eecc6}{\index{rpc.\+h@{rpc.\+h}!E\+V\+T\+A\+G\+\_\+\+A\+S\+S\+I\+G\+N@{E\+V\+T\+A\+G\+\_\+\+A\+S\+S\+I\+G\+N}}
\index{E\+V\+T\+A\+G\+\_\+\+A\+S\+S\+I\+G\+N@{E\+V\+T\+A\+G\+\_\+\+A\+S\+S\+I\+G\+N}!rpc.\+h@{rpc.\+h}}
\subsubsection[{E\+V\+T\+A\+G\+\_\+\+A\+S\+S\+I\+G\+N}]{\setlength{\rightskip}{0pt plus 5cm}\#define E\+V\+T\+A\+G\+\_\+\+A\+S\+S\+I\+G\+N(
\begin{DoxyParamCaption}
\item[{}]{msg, }
\item[{}]{member, }
\item[{}]{value}
\end{DoxyParamCaption}
)~($\ast$(msg)-\/$>$base-\/$>$member\#\#\+\_\+assign)((msg), (value))}}\label{rpc_8h_a8063c9f0927da79cc9e53600a77eecc6}


Assigns a value to the member in the message. 


\begin{DoxyParams}{Parameters}
{\em msg} & the message to which to assign a value \\
\hline
{\em member} & the name of the member variable \\
\hline
{\em value} & the value to assign \\
\hline
\end{DoxyParams}
\hypertarget{rpc_8h_af420133e56a545bef6cba6f878d403d7}{\index{rpc.\+h@{rpc.\+h}!E\+V\+T\+A\+G\+\_\+\+A\+S\+S\+I\+G\+N\+\_\+\+W\+I\+T\+H\+\_\+\+L\+E\+N@{E\+V\+T\+A\+G\+\_\+\+A\+S\+S\+I\+G\+N\+\_\+\+W\+I\+T\+H\+\_\+\+L\+E\+N}}
\index{E\+V\+T\+A\+G\+\_\+\+A\+S\+S\+I\+G\+N\+\_\+\+W\+I\+T\+H\+\_\+\+L\+E\+N@{E\+V\+T\+A\+G\+\_\+\+A\+S\+S\+I\+G\+N\+\_\+\+W\+I\+T\+H\+\_\+\+L\+E\+N}!rpc.\+h@{rpc.\+h}}
\subsubsection[{E\+V\+T\+A\+G\+\_\+\+A\+S\+S\+I\+G\+N\+\_\+\+W\+I\+T\+H\+\_\+\+L\+E\+N}]{\setlength{\rightskip}{0pt plus 5cm}\#define E\+V\+T\+A\+G\+\_\+\+A\+S\+S\+I\+G\+N\+\_\+\+W\+I\+T\+H\+\_\+\+L\+E\+N(
\begin{DoxyParamCaption}
\item[{}]{msg, }
\item[{}]{member, }
\item[{}]{value, }
\item[{}]{len}
\end{DoxyParamCaption}
)~($\ast$(msg)-\/$>$base-\/$>$member\#\#\+\_\+assign)((msg), (value), (len))}}\label{rpc_8h_af420133e56a545bef6cba6f878d403d7}


Assigns a value to the member in the message. 


\begin{DoxyParams}{Parameters}
{\em msg} & the message to which to assign a value \\
\hline
{\em member} & the name of the member variable \\
\hline
{\em value} & the value to assign \\
\hline
{\em len} & the length of the value \\
\hline
\end{DoxyParams}
\hypertarget{rpc_8h_aef6e54053208c090c43d05c9b2259fb9}{\index{rpc.\+h@{rpc.\+h}!E\+V\+T\+A\+G\+\_\+\+G\+E\+T@{E\+V\+T\+A\+G\+\_\+\+G\+E\+T}}
\index{E\+V\+T\+A\+G\+\_\+\+G\+E\+T@{E\+V\+T\+A\+G\+\_\+\+G\+E\+T}!rpc.\+h@{rpc.\+h}}
\subsubsection[{E\+V\+T\+A\+G\+\_\+\+G\+E\+T}]{\setlength{\rightskip}{0pt plus 5cm}\#define E\+V\+T\+A\+G\+\_\+\+G\+E\+T(
\begin{DoxyParamCaption}
\item[{}]{msg, }
\item[{}]{member, }
\item[{}]{pvalue}
\end{DoxyParamCaption}
)~($\ast$(msg)-\/$>$base-\/$>$member\#\#\+\_\+get)((msg), (pvalue))}}\label{rpc_8h_aef6e54053208c090c43d05c9b2259fb9}


Returns the value for a member. 


\begin{DoxyParams}{Parameters}
{\em msg} & the message from which to get the value \\
\hline
{\em member} & the name of the member variable \\
\hline
{\em pvalue} & a pointer to the variable to hold the value \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
0 on success, -\/1 otherwise. 
\end{DoxyReturn}
\hypertarget{rpc_8h_ae0b73ea41cb7f06976fd69a8f1be6219}{\index{rpc.\+h@{rpc.\+h}!E\+V\+T\+A\+G\+\_\+\+G\+E\+T\+\_\+\+W\+I\+T\+H\+\_\+\+L\+E\+N@{E\+V\+T\+A\+G\+\_\+\+G\+E\+T\+\_\+\+W\+I\+T\+H\+\_\+\+L\+E\+N}}
\index{E\+V\+T\+A\+G\+\_\+\+G\+E\+T\+\_\+\+W\+I\+T\+H\+\_\+\+L\+E\+N@{E\+V\+T\+A\+G\+\_\+\+G\+E\+T\+\_\+\+W\+I\+T\+H\+\_\+\+L\+E\+N}!rpc.\+h@{rpc.\+h}}
\subsubsection[{E\+V\+T\+A\+G\+\_\+\+G\+E\+T\+\_\+\+W\+I\+T\+H\+\_\+\+L\+E\+N}]{\setlength{\rightskip}{0pt plus 5cm}\#define E\+V\+T\+A\+G\+\_\+\+G\+E\+T\+\_\+\+W\+I\+T\+H\+\_\+\+L\+E\+N(
\begin{DoxyParamCaption}
\item[{}]{msg, }
\item[{}]{member, }
\item[{}]{pvalue, }
\item[{}]{plen}
\end{DoxyParamCaption}
)~($\ast$(msg)-\/$>$base-\/$>$member\#\#\+\_\+get)((msg), (pvalue), (plen))}}\label{rpc_8h_ae0b73ea41cb7f06976fd69a8f1be6219}


Returns the value for a member. 


\begin{DoxyParams}{Parameters}
{\em msg} & the message from which to get the value \\
\hline
{\em member} & the name of the member variable \\
\hline
{\em pvalue} & a pointer to the variable to hold the value \\
\hline
{\em plen} & a pointer to the length of the value \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
0 on success, -\/1 otherwise. 
\end{DoxyReturn}
\hypertarget{rpc_8h_a1a924e89c7a0c5eddc63cf9bf569fae6}{\index{rpc.\+h@{rpc.\+h}!E\+V\+T\+A\+G\+\_\+\+H\+A\+S@{E\+V\+T\+A\+G\+\_\+\+H\+A\+S}}
\index{E\+V\+T\+A\+G\+\_\+\+H\+A\+S@{E\+V\+T\+A\+G\+\_\+\+H\+A\+S}!rpc.\+h@{rpc.\+h}}
\subsubsection[{E\+V\+T\+A\+G\+\_\+\+H\+A\+S}]{\setlength{\rightskip}{0pt plus 5cm}\#define E\+V\+T\+A\+G\+\_\+\+H\+A\+S(
\begin{DoxyParamCaption}
\item[{}]{msg, }
\item[{}]{member}
\end{DoxyParamCaption}
)~((msg)-\/$>$member\#\#\+\_\+set == 1)}}\label{rpc_8h_a1a924e89c7a0c5eddc63cf9bf569fae6}


Determines if the member has been set in the message. 


\begin{DoxyParams}{Parameters}
{\em msg} & the message to inspect \\
\hline
{\em member} & the member variable to test for presences \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
1 if it's present or 0 otherwise. 
\end{DoxyReturn}
\hypertarget{rpc_8h_a1bb283bd7893b9855e2f23013891fc82}{\index{rpc.\+h@{rpc.\+h}!I\+N\+P\+U\+T@{I\+N\+P\+U\+T}}
\index{I\+N\+P\+U\+T@{I\+N\+P\+U\+T}!rpc.\+h@{rpc.\+h}}
\subsubsection[{I\+N\+P\+U\+T}]{\setlength{\rightskip}{0pt plus 5cm}\#define I\+N\+P\+U\+T~{\bf E\+V\+R\+P\+C\+\_\+\+I\+N\+P\+U\+T}}}\label{rpc_8h_a1bb283bd7893b9855e2f23013891fc82}


Deprecated alias for E\+V\+R\+P\+C\+\_\+\+I\+N\+P\+U\+T. 

Not available on windows, where it conflicts with platform headers. \hypertarget{rpc_8h_a61a3c9a18380aafb6e430e79bf596557}{\index{rpc.\+h@{rpc.\+h}!O\+U\+T\+P\+U\+T@{O\+U\+T\+P\+U\+T}}
\index{O\+U\+T\+P\+U\+T@{O\+U\+T\+P\+U\+T}!rpc.\+h@{rpc.\+h}}
\subsubsection[{O\+U\+T\+P\+U\+T}]{\setlength{\rightskip}{0pt plus 5cm}\#define O\+U\+T\+P\+U\+T~{\bf E\+V\+R\+P\+C\+\_\+\+O\+U\+T\+P\+U\+T}}}\label{rpc_8h_a61a3c9a18380aafb6e430e79bf596557}


Deprecated alias for E\+V\+R\+P\+C\+\_\+\+O\+U\+T\+P\+U\+T. 

Not available on windows, where it conflicts with platform headers. 

\subsection{Enumeration Type Documentation}
\hypertarget{rpc_8h_a9c37f133ebc96b2bd66c472079b1338b}{\index{rpc.\+h@{rpc.\+h}!E\+V\+R\+P\+C\+\_\+\+H\+O\+O\+K\+\_\+\+R\+E\+S\+U\+L\+T@{E\+V\+R\+P\+C\+\_\+\+H\+O\+O\+K\+\_\+\+R\+E\+S\+U\+L\+T}}
\index{E\+V\+R\+P\+C\+\_\+\+H\+O\+O\+K\+\_\+\+R\+E\+S\+U\+L\+T@{E\+V\+R\+P\+C\+\_\+\+H\+O\+O\+K\+\_\+\+R\+E\+S\+U\+L\+T}!rpc.\+h@{rpc.\+h}}
\subsubsection[{E\+V\+R\+P\+C\+\_\+\+H\+O\+O\+K\+\_\+\+R\+E\+S\+U\+L\+T}]{\setlength{\rightskip}{0pt plus 5cm}enum {\bf E\+V\+R\+P\+C\+\_\+\+H\+O\+O\+K\+\_\+\+R\+E\+S\+U\+L\+T}}}\label{rpc_8h_a9c37f133ebc96b2bd66c472079b1338b}


Return value from hook processing functions. 

\begin{Desc}
\item[Enumerator]\par
\begin{description}
\index{E\+V\+R\+P\+C\+\_\+\+T\+E\+R\+M\+I\+N\+A\+T\+E@{E\+V\+R\+P\+C\+\_\+\+T\+E\+R\+M\+I\+N\+A\+T\+E}!rpc.\+h@{rpc.\+h}}\index{rpc.\+h@{rpc.\+h}!E\+V\+R\+P\+C\+\_\+\+T\+E\+R\+M\+I\+N\+A\+T\+E@{E\+V\+R\+P\+C\+\_\+\+T\+E\+R\+M\+I\+N\+A\+T\+E}}\item[{\em 
\hypertarget{rpc_8h_a9c37f133ebc96b2bd66c472079b1338ba61de2cad490f408aa9ecc3427cfb6233}{E\+V\+R\+P\+C\+\_\+\+T\+E\+R\+M\+I\+N\+A\+T\+E}\label{rpc_8h_a9c37f133ebc96b2bd66c472079b1338ba61de2cad490f408aa9ecc3427cfb6233}
}]indicates the rpc should be terminated \index{E\+V\+R\+P\+C\+\_\+\+C\+O\+N\+T\+I\+N\+U\+E@{E\+V\+R\+P\+C\+\_\+\+C\+O\+N\+T\+I\+N\+U\+E}!rpc.\+h@{rpc.\+h}}\index{rpc.\+h@{rpc.\+h}!E\+V\+R\+P\+C\+\_\+\+C\+O\+N\+T\+I\+N\+U\+E@{E\+V\+R\+P\+C\+\_\+\+C\+O\+N\+T\+I\+N\+U\+E}}\item[{\em 
\hypertarget{rpc_8h_a9c37f133ebc96b2bd66c472079b1338ba4f92aee79d3413c4940eeb578ee33643}{E\+V\+R\+P\+C\+\_\+\+C\+O\+N\+T\+I\+N\+U\+E}\label{rpc_8h_a9c37f133ebc96b2bd66c472079b1338ba4f92aee79d3413c4940eeb578ee33643}
}]continue processing the rpc \index{E\+V\+R\+P\+C\+\_\+\+P\+A\+U\+S\+E@{E\+V\+R\+P\+C\+\_\+\+P\+A\+U\+S\+E}!rpc.\+h@{rpc.\+h}}\index{rpc.\+h@{rpc.\+h}!E\+V\+R\+P\+C\+\_\+\+P\+A\+U\+S\+E@{E\+V\+R\+P\+C\+\_\+\+P\+A\+U\+S\+E}}\item[{\em 
\hypertarget{rpc_8h_a9c37f133ebc96b2bd66c472079b1338baff86ced7cf446eec75868ba64d956b9c}{E\+V\+R\+P\+C\+\_\+\+P\+A\+U\+S\+E}\label{rpc_8h_a9c37f133ebc96b2bd66c472079b1338baff86ced7cf446eec75868ba64d956b9c}
}]pause processing request until resumed \end{description}
\end{Desc}
\hypertarget{rpc_8h_a66eff7ea6bdd17e53fde6c4d9dc1835b}{\index{rpc.\+h@{rpc.\+h}!E\+V\+R\+P\+C\+\_\+\+H\+O\+O\+K\+\_\+\+T\+Y\+P\+E@{E\+V\+R\+P\+C\+\_\+\+H\+O\+O\+K\+\_\+\+T\+Y\+P\+E}}
\index{E\+V\+R\+P\+C\+\_\+\+H\+O\+O\+K\+\_\+\+T\+Y\+P\+E@{E\+V\+R\+P\+C\+\_\+\+H\+O\+O\+K\+\_\+\+T\+Y\+P\+E}!rpc.\+h@{rpc.\+h}}
\subsubsection[{E\+V\+R\+P\+C\+\_\+\+H\+O\+O\+K\+\_\+\+T\+Y\+P\+E}]{\setlength{\rightskip}{0pt plus 5cm}enum {\bf E\+V\+R\+P\+C\+\_\+\+H\+O\+O\+K\+\_\+\+T\+Y\+P\+E}}}\label{rpc_8h_a66eff7ea6bdd17e53fde6c4d9dc1835b}


Hooks for changing the input and output of R\+P\+Cs; this can be used to implement compression, authentication, encryption, ... 

\begin{Desc}
\item[Enumerator]\par
\begin{description}
\index{E\+V\+R\+P\+C\+\_\+\+I\+N\+P\+U\+T@{E\+V\+R\+P\+C\+\_\+\+I\+N\+P\+U\+T}!rpc.\+h@{rpc.\+h}}\index{rpc.\+h@{rpc.\+h}!E\+V\+R\+P\+C\+\_\+\+I\+N\+P\+U\+T@{E\+V\+R\+P\+C\+\_\+\+I\+N\+P\+U\+T}}\item[{\em 
\hypertarget{rpc_8h_a66eff7ea6bdd17e53fde6c4d9dc1835ba2a62d2e1147edb5b460c1abb17be9734}{E\+V\+R\+P\+C\+\_\+\+I\+N\+P\+U\+T}\label{rpc_8h_a66eff7ea6bdd17e53fde6c4d9dc1835ba2a62d2e1147edb5b460c1abb17be9734}
}]apply the function to an input hook \index{E\+V\+R\+P\+C\+\_\+\+O\+U\+T\+P\+U\+T@{E\+V\+R\+P\+C\+\_\+\+O\+U\+T\+P\+U\+T}!rpc.\+h@{rpc.\+h}}\index{rpc.\+h@{rpc.\+h}!E\+V\+R\+P\+C\+\_\+\+O\+U\+T\+P\+U\+T@{E\+V\+R\+P\+C\+\_\+\+O\+U\+T\+P\+U\+T}}\item[{\em 
\hypertarget{rpc_8h_a66eff7ea6bdd17e53fde6c4d9dc1835bad63587ff3a66808e422f1ca48c9db85e}{E\+V\+R\+P\+C\+\_\+\+O\+U\+T\+P\+U\+T}\label{rpc_8h_a66eff7ea6bdd17e53fde6c4d9dc1835bad63587ff3a66808e422f1ca48c9db85e}
}]apply the function to an output hook \end{description}
\end{Desc}


\subsection{Function Documentation}
\hypertarget{rpc_8h_adb188728ddbaf5c85ac9e98d9d11a4a4}{\index{rpc.\+h@{rpc.\+h}!evrpc\+\_\+add\+\_\+hook@{evrpc\+\_\+add\+\_\+hook}}
\index{evrpc\+\_\+add\+\_\+hook@{evrpc\+\_\+add\+\_\+hook}!rpc.\+h@{rpc.\+h}}
\subsubsection[{evrpc\+\_\+add\+\_\+hook}]{\setlength{\rightskip}{0pt plus 5cm}void$\ast$ evrpc\+\_\+add\+\_\+hook (
\begin{DoxyParamCaption}
\item[{void $\ast$}]{vbase, }
\item[{enum {\bf E\+V\+R\+P\+C\+\_\+\+H\+O\+O\+K\+\_\+\+T\+Y\+P\+E}}]{hook\+\_\+type, }
\item[{int($\ast$)(void $\ast$, struct {\bf evhttp\+\_\+request} $\ast$, struct {\bf evbuffer} $\ast$, void $\ast$)}]{cb, }
\item[{void $\ast$}]{cb\+\_\+arg}
\end{DoxyParamCaption}
)}}\label{rpc_8h_adb188728ddbaf5c85ac9e98d9d11a4a4}


adds a processing hook to either an rpc base or rpc pool 

If a hook returns T\+E\+R\+M\+I\+N\+A\+T\+E, the processing is aborted. On C\+O\+N\+T\+I\+N\+U\+E, the request is immediately processed after the hook returns. If the hook returns P\+A\+U\+S\+E, request processing stops until \hyperlink{rpc_8h_a2724d98b6fc56d46cbfc9fe7ad9e6cf1}{evrpc\+\_\+resume\+\_\+request()} has been called.

The add functions return handles that can be used for removing hooks.


\begin{DoxyParams}{Parameters}
{\em vbase} & a pointer to either struct \hyperlink{structevrpc__base}{evrpc\+\_\+base} or struct \hyperlink{structevrpc__pool}{evrpc\+\_\+pool} \\
\hline
{\em hook\+\_\+type} & either I\+N\+P\+U\+T or O\+U\+T\+P\+U\+T \\
\hline
{\em cb} & the callback to call when the hook is activated \\
\hline
{\em cb\+\_\+arg} & an additional argument for the callback \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
a handle to the hook so it can be removed later 
\end{DoxyReturn}
\begin{DoxySeeAlso}{See also}
\hyperlink{rpc_8h_a3969ea92840d165cab55a3228efcdbc6}{evrpc\+\_\+remove\+\_\+hook()} 
\end{DoxySeeAlso}


References E\+V\+R\+P\+C\+\_\+\+I\+N\+P\+U\+T, and E\+V\+R\+P\+C\+\_\+\+O\+U\+T\+P\+U\+T.

\hypertarget{rpc_8h_a64a8951f0d52f698a96808f276b32f39}{\index{rpc.\+h@{rpc.\+h}!evrpc\+\_\+free@{evrpc\+\_\+free}}
\index{evrpc\+\_\+free@{evrpc\+\_\+free}!rpc.\+h@{rpc.\+h}}
\subsubsection[{evrpc\+\_\+free}]{\setlength{\rightskip}{0pt plus 5cm}void evrpc\+\_\+free (
\begin{DoxyParamCaption}
\item[{struct {\bf evrpc\+\_\+base} $\ast$}]{base}
\end{DoxyParamCaption}
)}}\label{rpc_8h_a64a8951f0d52f698a96808f276b32f39}


Frees the evrpc base. 

For now, you are responsible for making sure that no rpcs are ongoing.


\begin{DoxyParams}{Parameters}
{\em base} & the \hyperlink{structevrpc__base}{evrpc\+\_\+base} object to be freed \\
\hline
\end{DoxyParams}
\begin{DoxySeeAlso}{See also}
\hyperlink{rpc_8h_aca904025a4a1cb8d22164da3afe32b5a}{evrpc\+\_\+init} 
\end{DoxySeeAlso}


References E\+V\+R\+P\+C\+\_\+\+I\+N\+P\+U\+T, E\+V\+R\+P\+C\+\_\+\+O\+U\+T\+P\+U\+T, and evrpc\+\_\+remove\+\_\+hook().

\hypertarget{rpc_8h_a1e6e536a5c57a2d87ffe778746906626}{\index{rpc.\+h@{rpc.\+h}!evrpc\+\_\+hook\+\_\+add\+\_\+meta@{evrpc\+\_\+hook\+\_\+add\+\_\+meta}}
\index{evrpc\+\_\+hook\+\_\+add\+\_\+meta@{evrpc\+\_\+hook\+\_\+add\+\_\+meta}!rpc.\+h@{rpc.\+h}}
\subsubsection[{evrpc\+\_\+hook\+\_\+add\+\_\+meta}]{\setlength{\rightskip}{0pt plus 5cm}void evrpc\+\_\+hook\+\_\+add\+\_\+meta (
\begin{DoxyParamCaption}
\item[{void $\ast$}]{ctx, }
\item[{const char $\ast$}]{key, }
\item[{const void $\ast$}]{data, }
\item[{size\+\_\+t}]{data\+\_\+size}
\end{DoxyParamCaption}
)}}\label{rpc_8h_a1e6e536a5c57a2d87ffe778746906626}


adds meta data to request 

\hyperlink{rpc_8h_a1e6e536a5c57a2d87ffe778746906626}{evrpc\+\_\+hook\+\_\+add\+\_\+meta()} allows hooks to add meta data to a request. for a client request, the meta data can be inserted by an outgoing request hook and retrieved by the incoming request hook.


\begin{DoxyParams}{Parameters}
{\em ctx} & the context provided to the hook call \\
\hline
{\em key} & a N\+U\+L-\/terminated c-\/string \\
\hline
{\em data} & the data to be associated with the key \\
\hline
{\em data\+\_\+size} & the size of the data \\
\hline
\end{DoxyParams}
\hypertarget{rpc_8h_aad4ec382ca6789ac5bdc672420d98fc5}{\index{rpc.\+h@{rpc.\+h}!evrpc\+\_\+hook\+\_\+find\+\_\+meta@{evrpc\+\_\+hook\+\_\+find\+\_\+meta}}
\index{evrpc\+\_\+hook\+\_\+find\+\_\+meta@{evrpc\+\_\+hook\+\_\+find\+\_\+meta}!rpc.\+h@{rpc.\+h}}
\subsubsection[{evrpc\+\_\+hook\+\_\+find\+\_\+meta}]{\setlength{\rightskip}{0pt plus 5cm}int evrpc\+\_\+hook\+\_\+find\+\_\+meta (
\begin{DoxyParamCaption}
\item[{void $\ast$}]{ctx, }
\item[{const char $\ast$}]{key, }
\item[{void $\ast$$\ast$}]{data, }
\item[{size\+\_\+t $\ast$}]{data\+\_\+size}
\end{DoxyParamCaption}
)}}\label{rpc_8h_aad4ec382ca6789ac5bdc672420d98fc5}


retrieves meta data previously associated 

\hyperlink{rpc_8h_aad4ec382ca6789ac5bdc672420d98fc5}{evrpc\+\_\+hook\+\_\+find\+\_\+meta()} can be used to retrieve meta data associated to a request by a previous hook. 
\begin{DoxyParams}{Parameters}
{\em ctx} & the context provided to the hook call \\
\hline
{\em key} & a N\+U\+L-\/terminated c-\/string \\
\hline
{\em data} & pointer to a data pointer that will contain the retrieved data \\
\hline
{\em data\+\_\+size} & pointer to the size of the data \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
0 on success or -\/1 on failure 
\end{DoxyReturn}
\hypertarget{rpc_8h_a3aef04ab91e1af62675cd7d76fd06e94}{\index{rpc.\+h@{rpc.\+h}!evrpc\+\_\+hook\+\_\+get\+\_\+connection@{evrpc\+\_\+hook\+\_\+get\+\_\+connection}}
\index{evrpc\+\_\+hook\+\_\+get\+\_\+connection@{evrpc\+\_\+hook\+\_\+get\+\_\+connection}!rpc.\+h@{rpc.\+h}}
\subsubsection[{evrpc\+\_\+hook\+\_\+get\+\_\+connection}]{\setlength{\rightskip}{0pt plus 5cm}struct {\bf evhttp\+\_\+connection}$\ast$ evrpc\+\_\+hook\+\_\+get\+\_\+connection (
\begin{DoxyParamCaption}
\item[{void $\ast$}]{ctx}
\end{DoxyParamCaption}
)}}\label{rpc_8h_a3aef04ab91e1af62675cd7d76fd06e94}


returns the connection object associated with the request 


\begin{DoxyParams}{Parameters}
{\em ctx} & the context provided to the hook call \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
a pointer to the \hyperlink{structevhttp__connection}{evhttp\+\_\+connection} object 
\end{DoxyReturn}
\hypertarget{rpc_8h_aca904025a4a1cb8d22164da3afe32b5a}{\index{rpc.\+h@{rpc.\+h}!evrpc\+\_\+init@{evrpc\+\_\+init}}
\index{evrpc\+\_\+init@{evrpc\+\_\+init}!rpc.\+h@{rpc.\+h}}
\subsubsection[{evrpc\+\_\+init}]{\setlength{\rightskip}{0pt plus 5cm}struct {\bf evrpc\+\_\+base}$\ast$ evrpc\+\_\+init (
\begin{DoxyParamCaption}
\item[{struct {\bf evhttp} $\ast$}]{server}
\end{DoxyParamCaption}
)}}\label{rpc_8h_aca904025a4a1cb8d22164da3afe32b5a}


Creates a new rpc base from which R\+P\+C requests can be received. 


\begin{DoxyParams}{Parameters}
{\em server} & a pointer to an existing H\+T\+T\+P server \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
a newly allocated \hyperlink{structevrpc__base}{evrpc\+\_\+base} struct 
\end{DoxyReturn}
\begin{DoxySeeAlso}{See also}
\hyperlink{rpc_8h_a64a8951f0d52f698a96808f276b32f39}{evrpc\+\_\+free()} 
\end{DoxySeeAlso}
\hypertarget{rpc_8h_a1bc336c8cb4b87e77fd35c697420b3c5}{\index{rpc.\+h@{rpc.\+h}!evrpc\+\_\+make\+\_\+request@{evrpc\+\_\+make\+\_\+request}}
\index{evrpc\+\_\+make\+\_\+request@{evrpc\+\_\+make\+\_\+request}!rpc.\+h@{rpc.\+h}}
\subsubsection[{evrpc\+\_\+make\+\_\+request}]{\setlength{\rightskip}{0pt plus 5cm}int evrpc\+\_\+make\+\_\+request (
\begin{DoxyParamCaption}
\item[{struct {\bf evrpc\+\_\+request\+\_\+wrapper} $\ast$}]{ctx}
\end{DoxyParamCaption}
)}}\label{rpc_8h_a1bc336c8cb4b87e77fd35c697420b3c5}


Makes an R\+P\+C request based on the provided context. 

This is a low-\/level function and should not be used directly unless a custom context object is provided. Use \hyperlink{rpc_8h_aff0efcd7cb8b966256b5127960bd2c81}{E\+V\+R\+P\+C\+\_\+\+M\+A\+K\+E\+\_\+\+R\+E\+Q\+U\+E\+S\+T()} instead.


\begin{DoxyParams}{Parameters}
{\em ctx} & a context from \hyperlink{rpc_8h_ad7694fa8f1b5995a9d43bef1da170fad}{E\+V\+R\+P\+C\+\_\+\+M\+A\+K\+E\+\_\+\+C\+T\+X()} \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
0 on success, -\/1 otherwise. 
\end{DoxyReturn}
\begin{DoxySeeAlso}{See also}
\hyperlink{rpc_8h_aff0efcd7cb8b966256b5127960bd2c81}{E\+V\+R\+P\+C\+\_\+\+M\+A\+K\+E\+\_\+\+R\+E\+Q\+U\+E\+S\+T()}, \hyperlink{rpc_8h_ad7694fa8f1b5995a9d43bef1da170fad}{E\+V\+R\+P\+C\+\_\+\+M\+A\+K\+E\+\_\+\+C\+T\+X()} 
\end{DoxySeeAlso}


Referenced by evrpc\+\_\+send\+\_\+request\+\_\+generic().

\hypertarget{rpc_8h_a063d8c73017ee732c8930e9c6fa00026}{\index{rpc.\+h@{rpc.\+h}!evrpc\+\_\+pool\+\_\+add\+\_\+connection@{evrpc\+\_\+pool\+\_\+add\+\_\+connection}}
\index{evrpc\+\_\+pool\+\_\+add\+\_\+connection@{evrpc\+\_\+pool\+\_\+add\+\_\+connection}!rpc.\+h@{rpc.\+h}}
\subsubsection[{evrpc\+\_\+pool\+\_\+add\+\_\+connection}]{\setlength{\rightskip}{0pt plus 5cm}void evrpc\+\_\+pool\+\_\+add\+\_\+connection (
\begin{DoxyParamCaption}
\item[{struct {\bf evrpc\+\_\+pool} $\ast$}]{pool, }
\item[{struct {\bf evhttp\+\_\+connection} $\ast$}]{evcon}
\end{DoxyParamCaption}
)}}\label{rpc_8h_a063d8c73017ee732c8930e9c6fa00026}


Adds a connection over which rpc can be dispatched to the pool. 

The connection object must have been newly created.


\begin{DoxyParams}{Parameters}
{\em pool} & the pool to which to add the connection \\
\hline
{\em evcon} & the connection to add to the pool. \\
\hline
\end{DoxyParams}


References evhttp\+\_\+connection\+\_\+set\+\_\+base().

\hypertarget{rpc_8h_a8d3e64475898ca58fd93b7f8919b3a01}{\index{rpc.\+h@{rpc.\+h}!evrpc\+\_\+pool\+\_\+free@{evrpc\+\_\+pool\+\_\+free}}
\index{evrpc\+\_\+pool\+\_\+free@{evrpc\+\_\+pool\+\_\+free}!rpc.\+h@{rpc.\+h}}
\subsubsection[{evrpc\+\_\+pool\+\_\+free}]{\setlength{\rightskip}{0pt plus 5cm}void evrpc\+\_\+pool\+\_\+free (
\begin{DoxyParamCaption}
\item[{struct {\bf evrpc\+\_\+pool} $\ast$}]{pool}
\end{DoxyParamCaption}
)}}\label{rpc_8h_a8d3e64475898ca58fd93b7f8919b3a01}


frees an rpc connection pool 


\begin{DoxyParams}{Parameters}
{\em pool} & a pointer to an \hyperlink{structevrpc__pool}{evrpc\+\_\+pool} allocated via \hyperlink{rpc_8h_a8e87434603994a71d26676ddfb1e2033}{evrpc\+\_\+pool\+\_\+new()} \\
\hline
\end{DoxyParams}
\begin{DoxySeeAlso}{See also}
\hyperlink{rpc_8h_a8e87434603994a71d26676ddfb1e2033}{evrpc\+\_\+pool\+\_\+new()} 
\end{DoxySeeAlso}


References evhttp\+\_\+connection\+\_\+free(), E\+V\+R\+P\+C\+\_\+\+I\+N\+P\+U\+T, E\+V\+R\+P\+C\+\_\+\+O\+U\+T\+P\+U\+T, and evrpc\+\_\+remove\+\_\+hook().

\hypertarget{rpc_8h_a8e87434603994a71d26676ddfb1e2033}{\index{rpc.\+h@{rpc.\+h}!evrpc\+\_\+pool\+\_\+new@{evrpc\+\_\+pool\+\_\+new}}
\index{evrpc\+\_\+pool\+\_\+new@{evrpc\+\_\+pool\+\_\+new}!rpc.\+h@{rpc.\+h}}
\subsubsection[{evrpc\+\_\+pool\+\_\+new}]{\setlength{\rightskip}{0pt plus 5cm}struct {\bf evrpc\+\_\+pool}$\ast$ evrpc\+\_\+pool\+\_\+new (
\begin{DoxyParamCaption}
\item[{struct {\bf event\+\_\+base} $\ast$}]{base}
\end{DoxyParamCaption}
)}}\label{rpc_8h_a8e87434603994a71d26676ddfb1e2033}


creates an rpc connection pool 

a pool has a number of connections associated with it. rpc requests are always made via a pool.


\begin{DoxyParams}{Parameters}
{\em base} & a pointer to an struct event\+\_\+based object; can be left N\+U\+L\+L in singled-\/threaded applications \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
a newly allocated struct \hyperlink{structevrpc__pool}{evrpc\+\_\+pool} object 
\end{DoxyReturn}
\begin{DoxySeeAlso}{See also}
\hyperlink{rpc_8h_a8d3e64475898ca58fd93b7f8919b3a01}{evrpc\+\_\+pool\+\_\+free()} 
\end{DoxySeeAlso}
\hypertarget{rpc_8h_a707034fc4c7ba1021dd081863797e6e7}{\index{rpc.\+h@{rpc.\+h}!evrpc\+\_\+pool\+\_\+remove\+\_\+connection@{evrpc\+\_\+pool\+\_\+remove\+\_\+connection}}
\index{evrpc\+\_\+pool\+\_\+remove\+\_\+connection@{evrpc\+\_\+pool\+\_\+remove\+\_\+connection}!rpc.\+h@{rpc.\+h}}
\subsubsection[{evrpc\+\_\+pool\+\_\+remove\+\_\+connection}]{\setlength{\rightskip}{0pt plus 5cm}void evrpc\+\_\+pool\+\_\+remove\+\_\+connection (
\begin{DoxyParamCaption}
\item[{struct {\bf evrpc\+\_\+pool} $\ast$}]{pool, }
\item[{struct {\bf evhttp\+\_\+connection} $\ast$}]{evcon}
\end{DoxyParamCaption}
)}}\label{rpc_8h_a707034fc4c7ba1021dd081863797e6e7}


Removes a connection from the pool. 

The connection object must have been newly created.


\begin{DoxyParams}{Parameters}
{\em pool} & the pool from which to remove the connection \\
\hline
{\em evcon} & the connection to remove from the pool. \\
\hline
\end{DoxyParams}
\hypertarget{rpc_8h_a17dae9e4a25a500e521baf5a2c1c5c0a}{\index{rpc.\+h@{rpc.\+h}!evrpc\+\_\+pool\+\_\+set\+\_\+timeout@{evrpc\+\_\+pool\+\_\+set\+\_\+timeout}}
\index{evrpc\+\_\+pool\+\_\+set\+\_\+timeout@{evrpc\+\_\+pool\+\_\+set\+\_\+timeout}!rpc.\+h@{rpc.\+h}}
\subsubsection[{evrpc\+\_\+pool\+\_\+set\+\_\+timeout}]{\setlength{\rightskip}{0pt plus 5cm}void evrpc\+\_\+pool\+\_\+set\+\_\+timeout (
\begin{DoxyParamCaption}
\item[{struct {\bf evrpc\+\_\+pool} $\ast$}]{pool, }
\item[{int}]{timeout\+\_\+in\+\_\+secs}
\end{DoxyParamCaption}
)}}\label{rpc_8h_a17dae9e4a25a500e521baf5a2c1c5c0a}


Sets the timeout in secs after which a request has to complete. 

The R\+P\+C is completely aborted if it does not complete by then. Setting the timeout to 0 means that it never timeouts and can be used to implement callback type R\+P\+Cs.

Any connection already in the pool will be updated with the new timeout. Connections added to the pool after set\+\_\+timeout has be called receive the pool timeout only if no timeout has been set for the connection itself.


\begin{DoxyParams}{Parameters}
{\em pool} & a pointer to a struct \hyperlink{structevrpc__pool}{evrpc\+\_\+pool} object \\
\hline
{\em timeout\+\_\+in\+\_\+secs} & the number of seconds after which a request should timeout and a failure be returned to the callback. \\
\hline
\end{DoxyParams}
\hypertarget{rpc_8h_a5987c57760de0cfb2639e36406ae99d8}{\index{rpc.\+h@{rpc.\+h}!evrpc\+\_\+register\+\_\+generic@{evrpc\+\_\+register\+\_\+generic}}
\index{evrpc\+\_\+register\+\_\+generic@{evrpc\+\_\+register\+\_\+generic}!rpc.\+h@{rpc.\+h}}
\subsubsection[{evrpc\+\_\+register\+\_\+generic}]{\setlength{\rightskip}{0pt plus 5cm}int evrpc\+\_\+register\+\_\+generic (
\begin{DoxyParamCaption}
\item[{struct {\bf evrpc\+\_\+base} $\ast$}]{base, }
\item[{const char $\ast$}]{name, }
\item[{void($\ast$)(struct {\bf evrpc\+\_\+req\+\_\+generic} $\ast$, void $\ast$)}]{callback, }
\item[{void $\ast$}]{cbarg, }
\item[{void $\ast$($\ast$)(void $\ast$)}]{req\+\_\+new, }
\item[{void $\ast$}]{req\+\_\+new\+\_\+arg, }
\item[{void($\ast$)(void $\ast$)}]{req\+\_\+free, }
\item[{int($\ast$)(void $\ast$, struct {\bf evbuffer} $\ast$)}]{req\+\_\+unmarshal, }
\item[{void $\ast$($\ast$)(void $\ast$)}]{rpl\+\_\+new, }
\item[{void $\ast$}]{rpl\+\_\+new\+\_\+arg, }
\item[{void($\ast$)(void $\ast$)}]{rpl\+\_\+free, }
\item[{int($\ast$)(void $\ast$)}]{rpl\+\_\+complete, }
\item[{void($\ast$)(struct {\bf evbuffer} $\ast$, void $\ast$)}]{rpl\+\_\+marshal}
\end{DoxyParamCaption}
)}}\label{rpc_8h_a5987c57760de0cfb2639e36406ae99d8}


\hyperlink{structFunction}{Function} for registering a generic R\+P\+C with the R\+P\+C base. 

Do not call this function directly, use \hyperlink{rpc_8h_abb204281e2555a1e91ff3885747d0533}{E\+V\+R\+P\+C\+\_\+\+R\+E\+G\+I\+S\+T\+E\+R()} instead.

\begin{DoxySeeAlso}{See also}
\hyperlink{rpc_8h_abb204281e2555a1e91ff3885747d0533}{E\+V\+R\+P\+C\+\_\+\+R\+E\+G\+I\+S\+T\+E\+R()} 
\end{DoxySeeAlso}


References evrpc\+\_\+register\+\_\+rpc().

\hypertarget{rpc_8h_abaa7d70da1d9fdcb767279b55944be65}{\index{rpc.\+h@{rpc.\+h}!evrpc\+\_\+register\+\_\+rpc@{evrpc\+\_\+register\+\_\+rpc}}
\index{evrpc\+\_\+register\+\_\+rpc@{evrpc\+\_\+register\+\_\+rpc}!rpc.\+h@{rpc.\+h}}
\subsubsection[{evrpc\+\_\+register\+\_\+rpc}]{\setlength{\rightskip}{0pt plus 5cm}int evrpc\+\_\+register\+\_\+rpc (
\begin{DoxyParamCaption}
\item[{struct {\bf evrpc\+\_\+base} $\ast$}]{, }
\item[{struct {\bf evrpc} $\ast$}]{, }
\item[{void($\ast$)(struct {\bf evrpc\+\_\+req\+\_\+generic} $\ast$, void $\ast$)}]{, }
\item[{void $\ast$}]{}
\end{DoxyParamCaption}
)}}\label{rpc_8h_abaa7d70da1d9fdcb767279b55944be65}


Low level function for registering an R\+P\+C with a server. 

Use \hyperlink{rpc_8h_abb204281e2555a1e91ff3885747d0533}{E\+V\+R\+P\+C\+\_\+\+R\+E\+G\+I\+S\+T\+E\+R()} instead.

\begin{DoxySeeAlso}{See also}
\hyperlink{rpc_8h_abb204281e2555a1e91ff3885747d0533}{E\+V\+R\+P\+C\+\_\+\+R\+E\+G\+I\+S\+T\+E\+R()} 
\end{DoxySeeAlso}


References evhttp\+\_\+set\+\_\+cb().



Referenced by evrpc\+\_\+register\+\_\+generic().

\hypertarget{rpc_8h_a3969ea92840d165cab55a3228efcdbc6}{\index{rpc.\+h@{rpc.\+h}!evrpc\+\_\+remove\+\_\+hook@{evrpc\+\_\+remove\+\_\+hook}}
\index{evrpc\+\_\+remove\+\_\+hook@{evrpc\+\_\+remove\+\_\+hook}!rpc.\+h@{rpc.\+h}}
\subsubsection[{evrpc\+\_\+remove\+\_\+hook}]{\setlength{\rightskip}{0pt plus 5cm}int evrpc\+\_\+remove\+\_\+hook (
\begin{DoxyParamCaption}
\item[{void $\ast$}]{vbase, }
\item[{enum {\bf E\+V\+R\+P\+C\+\_\+\+H\+O\+O\+K\+\_\+\+T\+Y\+P\+E}}]{hook\+\_\+type, }
\item[{void $\ast$}]{handle}
\end{DoxyParamCaption}
)}}\label{rpc_8h_a3969ea92840d165cab55a3228efcdbc6}


removes a previously added hook 


\begin{DoxyParams}{Parameters}
{\em vbase} & a pointer to either struct \hyperlink{structevrpc__base}{evrpc\+\_\+base} or struct \hyperlink{structevrpc__pool}{evrpc\+\_\+pool} \\
\hline
{\em hook\+\_\+type} & either I\+N\+P\+U\+T or O\+U\+T\+P\+U\+T \\
\hline
{\em handle} & a handle returned by \hyperlink{rpc_8h_adb188728ddbaf5c85ac9e98d9d11a4a4}{evrpc\+\_\+add\+\_\+hook()} \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
1 on success or 0 on failure 
\end{DoxyReturn}
\begin{DoxySeeAlso}{See also}
\hyperlink{rpc_8h_adb188728ddbaf5c85ac9e98d9d11a4a4}{evrpc\+\_\+add\+\_\+hook()} 
\end{DoxySeeAlso}


References E\+V\+R\+P\+C\+\_\+\+I\+N\+P\+U\+T, and E\+V\+R\+P\+C\+\_\+\+O\+U\+T\+P\+U\+T.



Referenced by evrpc\+\_\+free(), and evrpc\+\_\+pool\+\_\+free().

\hypertarget{rpc_8h_a2724d98b6fc56d46cbfc9fe7ad9e6cf1}{\index{rpc.\+h@{rpc.\+h}!evrpc\+\_\+resume\+\_\+request@{evrpc\+\_\+resume\+\_\+request}}
\index{evrpc\+\_\+resume\+\_\+request@{evrpc\+\_\+resume\+\_\+request}!rpc.\+h@{rpc.\+h}}
\subsubsection[{evrpc\+\_\+resume\+\_\+request}]{\setlength{\rightskip}{0pt plus 5cm}int evrpc\+\_\+resume\+\_\+request (
\begin{DoxyParamCaption}
\item[{void $\ast$}]{vbase, }
\item[{void $\ast$}]{ctx, }
\item[{enum {\bf E\+V\+R\+P\+C\+\_\+\+H\+O\+O\+K\+\_\+\+R\+E\+S\+U\+L\+T}}]{res}
\end{DoxyParamCaption}
)}}\label{rpc_8h_a2724d98b6fc56d46cbfc9fe7ad9e6cf1}


resume a paused request 


\begin{DoxyParams}{Parameters}
{\em vbase} & a pointer to either struct \hyperlink{structevrpc__base}{evrpc\+\_\+base} or struct \hyperlink{structevrpc__pool}{evrpc\+\_\+pool} \\
\hline
{\em ctx} & the context pointer provided to the original hook call \\
\hline
\end{DoxyParams}
\hypertarget{rpc_8h_a3d0c80cbf69003059bcdef4bfdbb321f}{\index{rpc.\+h@{rpc.\+h}!evrpc\+\_\+send\+\_\+request\+\_\+generic@{evrpc\+\_\+send\+\_\+request\+\_\+generic}}
\index{evrpc\+\_\+send\+\_\+request\+\_\+generic@{evrpc\+\_\+send\+\_\+request\+\_\+generic}!rpc.\+h@{rpc.\+h}}
\subsubsection[{evrpc\+\_\+send\+\_\+request\+\_\+generic}]{\setlength{\rightskip}{0pt plus 5cm}int evrpc\+\_\+send\+\_\+request\+\_\+generic (
\begin{DoxyParamCaption}
\item[{struct {\bf evrpc\+\_\+pool} $\ast$}]{pool, }
\item[{void $\ast$}]{request, }
\item[{void $\ast$}]{reply, }
\item[{void($\ast$)(struct {\bf evrpc\+\_\+status} $\ast$, void $\ast$, void $\ast$, void $\ast$)}]{cb, }
\item[{void $\ast$}]{cb\+\_\+arg, }
\item[{const char $\ast$}]{rpcname, }
\item[{void($\ast$)(struct {\bf evbuffer} $\ast$, void $\ast$)}]{req\+\_\+marshal, }
\item[{void($\ast$)(void $\ast$)}]{rpl\+\_\+clear, }
\item[{int($\ast$)(void $\ast$, struct {\bf evbuffer} $\ast$)}]{rpl\+\_\+unmarshal}
\end{DoxyParamCaption}
)}}\label{rpc_8h_a3d0c80cbf69003059bcdef4bfdbb321f}


\hyperlink{structFunction}{Function} for sending a generic R\+P\+C request. 

Do not call this function directly, use \hyperlink{rpc_8h_aff0efcd7cb8b966256b5127960bd2c81}{E\+V\+R\+P\+C\+\_\+\+M\+A\+K\+E\+\_\+\+R\+E\+Q\+U\+E\+S\+T()} instead.

\begin{DoxySeeAlso}{See also}
\hyperlink{rpc_8h_aff0efcd7cb8b966256b5127960bd2c81}{E\+V\+R\+P\+C\+\_\+\+M\+A\+K\+E\+\_\+\+R\+E\+Q\+U\+E\+S\+T()} 
\end{DoxySeeAlso}


References evrpc\+\_\+make\+\_\+request(), and evrpc\+\_\+make\+\_\+request\+\_\+ctx().

