lichao
2021-04-06 bb9a7e348892eb5c4fccb063380aa6fcd9612b71
src/topic_request.h
File was renamed from src/reqrep.h
@@ -1,9 +1,9 @@
/*
 * =====================================================================================
 *
 *       Filename:  reqrep.h
 *       Filename:  topic_request.h
 *
 *    Description:  topic request/reply sockets
 *    Description:  topic request socket
 *
 *        Version:  1.0
 *        Created:  2021年04月01日 09时36分06秒
@@ -15,8 +15,8 @@
 *
 * =====================================================================================
 */
#ifndef REQREP_ACEH09NK
#define REQREP_ACEH09NK
#ifndef TOPIC_REQUEST_ACEH09NK
#define TOPIC_REQUEST_ACEH09NK
#include "bh_util.h"
#include "defs.h"
@@ -105,26 +105,4 @@
   TopicCache topic_cache_;
};
class SocketReply : private ShmSocket
{
   typedef ShmSocket Socket;
public:
   SocketReply(Socket::Shm &shm) :
       Socket(shm, 64) {}
   SocketReply() :
       SocketReply(BHomeShm()) {}
   ~SocketReply() { Stop(); }
   typedef std::function<bool(const std::string &topic, const std::string &data, std::string &reply)> OnRequest;
   bool StartWorker(const OnRequest &rcb, int nworker = 2);
   bool Stop() { return Socket::Stop(); }
   bool RecvRequest(void *&src_info, std::string &topic, std::string &data, const int timeout_ms);
   bool SendReply(void *src_info, const std::string &data, const int timeout_ms);
   bool Register(const ProcInfo &proc_info, const std::vector<std::string> &topics, const int timeout_ms);
   bool Heartbeat(const ProcInfo &proc_info, const int timeout_ms);
private:
};
#endif // end of include guard: REQREP_ACEH09NK
#endif // end of include guard: TOPIC_REQUEST_ACEH09NK