1
#ifndef __clindexerprotocol__
2
#define __clindexerprotocol__
4
#include "named_pipe.h"
5
#include "cl_indexer_reply.h"
6
#include "cl_indexer_request.h"
9
class clIndexerProtocol {
16
* @brief send request to the server.
17
* @param conn connection to use. The connection should already be connected
18
* @param req request to send
19
* @return true on success, false otherwise
21
static bool SendRequest (clNamedPipe *conn, clIndexerRequest &req );
23
* @brief convert reply to binary and send it to the caller using named pipe.
24
* @param conn [input] named pipe to use
25
* @param reply [input] reply to send
26
* @return true on success, false otherwise
28
static bool SendReply (clNamedPipe *conn, clIndexerReply &reply);
30
* @brief read request from the named pipe. If any error occured, return false and abort the connection
31
* @param conn [input] named pipe to use for reading the request
32
* @param req [output] holds the received request. Should be used only if this function
34
* @return true on success, false otherwise
36
static bool ReadRequest (clNamedPipe *conn, clIndexerRequest &req );
38
* @brief read reply from the server.
39
* @param conn connection to use
40
* @param reply [output]
41
* @return true on success, false otherwise
43
static bool ReadReply (clNamedPipe *conn, clIndexerReply &reply);
46
#endif // __clindexerprotocol__