open-source-search-engine/Msg28.h

65 lines
1.3 KiB
C
Raw Normal View History

2013-08-03 00:12:24 +04:00
// Matt Wells, copyright Sep 2004
// . propagate config changes to all hosts via an http request
// . uses udp server
// . keeps sending forever to dead hosts
#ifndef _MSG28_H_
#define _MSG28_H_
#include "TcpSocket.h"
#include "HttpRequest.h"
class Msg28 {
public:
Msg28();
~Msg28();
bool massConfig ( char *requestBuf ,
void *state ,
void (* callback) (void *state ) ) ;
// . returns false if blocked, true otherwise
// . sets g_errno on error
// . sendToProxy only used to stop the proxy
bool massConfig ( class TcpSocket *s, class HttpRequest *r ,
2014-11-11 01:45:11 +03:00
int32_t hostId ,
2013-08-03 00:12:24 +04:00
void *state , void (* callback) (void *state) ,
bool ourselvesLast = true ,
bool sendToProxy = false ,
// this not -1 if specifying a range of docids
// in the closed interval, [hostId,hostId2]
2014-11-11 01:45:11 +03:00
int32_t hostId2 = -1 );
2013-08-03 00:12:24 +04:00
bool registerHandler ( ) ;
bool doSendLoop ( );
bool m_ourselvesLast;
void *m_state;
void (* m_callback ) ( void *state );
2014-11-11 01:45:11 +03:00
int32_t m_i;
2013-08-03 00:12:24 +04:00
char *m_buf;
2014-11-11 01:45:11 +03:00
int32_t m_bufSize;
int32_t m_bufLen;
2013-08-03 00:12:24 +04:00
2014-11-11 01:45:11 +03:00
int32_t m_numRequests;
int32_t m_numReplies;
int32_t m_numHosts;
2013-08-03 00:12:24 +04:00
2014-11-11 01:45:11 +03:00
int32_t m_hostId;
int32_t m_hostId2;
2013-08-03 00:12:24 +04:00
bool m_sendToProxy;
2014-11-11 01:45:11 +03:00
int32_t m_sendTotal;
2013-08-03 00:12:24 +04:00
bool m_freeBuf;
};
#endif