23 lines
555 B
C++
23 lines
555 B
C++
#pragma once
|
|
#include "core.h"
|
|
|
|
/**
|
|
* @brief unix-domain 请求,回复 实现
|
|
*
|
|
*/
|
|
class UnixDomainRequestReply : public IpcRequestReplyInterface {
|
|
public:
|
|
UnixDomainRequestReply();
|
|
~UnixDomainRequestReply();
|
|
|
|
std::expected<std::string, std::string> receive() override;
|
|
std::expected<void, std::string> send(const std::string& message) override;
|
|
};
|
|
|
|
// unix-domain 地址
|
|
constexpr const char* SOCKET_PATH = "/tmp/unix_domain_socket";
|
|
|
|
// 默认重试次数
|
|
const int RETRY_COUNT = 10;
|
|
// 重试间隔(毫秒)
|
|
const int RETRY_DELAY_MS = 500; |