| | |
| | | bool StartWorker(int nworker = 2) { return StartWorker(RequestResultCB(), nworker); } |
| | | bool Stop() { return Socket::Stop(); } |
| | | bool AsyncRequest(const Topic &topic, const void *data, const size_t size, const int timeout_ms, const RequestResultCB &rrcb); |
| | | bool AsyncRequest(const Topic &topic, const void *data, const size_t size, const int timeout_ms); |
| | | |
| | | bool AsyncRequest(const Topic &topic, const std::string &data, const int timeout_ms, const RequestResultCB &rrcb) |
| | | { |
| | | return AsyncRequest(topic, data.data(), data.size(), timeout_ms, rrcb); |
| | | } |
| | | bool AsyncRequest(const Topic &topic, const std::string &data, const int timeout_ms) |
| | | { |
| | | return AsyncRequest(topic, data.data(), data.size(), timeout_ms); |
| | | } |
| | | bool SyncRequest(const Topic &topic, const void *data, const size_t size, std::string &out, const int timeout_ms); |
| | | bool SyncRequest(const Topic &topic, const std::string &data, std::string &out, const int timeout_ms) |
| | |
| | | } |
| | | |
| | | private: |
| | | bool AsyncSend(const void *remote, const void *msg, const int timeout_ms, const RecvCB &cb); |
| | | bool AsyncSend(const void *remote, const void *msg, const int timeout_ms, const RecvBHMsgCB &cb); |
| | | bool AsyncSend(const void *remote, const void *msg, const int timeout_ms); |
| | | bool SyncSendAndRecv(const void *remote, const void *msg, void *result, const int timeout_ms); |
| | | bool QueryRPCTopic(const Topic &topic, bhome::msg::BHAddress &addr, const int timeout_ms); |
| | | std::unordered_map<std::string, RecvCB> async_cbs_; |
| | | std::unordered_map<std::string, RecvBHMsgCB> async_cbs_; |
| | | |
| | | typedef bhome_msg::BHAddress Address; |
| | | class TopicCache |