Skip to content

Commit 79db154

Browse files
committed
fix(sdk-cpp): 补交 tcp_transport.h——<queue> include 与 inbound 公开接口
上两提交(b9397da4b 主实现 / fe9bf0d 修复)都没带上这个头文件: - <queue> 缺失 → inbound_queue_ 声明失败连锁(SDK 镜像与 CI - C++ 连续红灯:'queue' does not name a template type) - inbound 方法块误落 private 段 → SetInboundHandler 不可达 工作区早有修复但未 git add——本次补交。
1 parent 977bcac commit 79db154

1 file changed

Lines changed: 12 additions & 11 deletions

File tree

sdks/cpp/include/croupier/sdk/tcp_transport.h

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#include <functional>
1515
#include <memory>
1616
#include <mutex>
17+
#include <queue>
1718
#include <string>
1819
#include <thread>
1920
#include <unordered_map>
@@ -107,6 +108,17 @@ class TCPTransport {
107108
*/
108109
bool IsConnected() const;
109110

111+
// ---- Inbound (Agent -> Provider calls) ----
112+
// Read loop only dispatches; handlers run on a bounded worker pool
113+
// (default = hardware concurrency, queue = workers * 4, overflow
114+
// fast-fails with an empty response so Agent failover takes over).
115+
using InboundHandler = std::function<std::vector<uint8_t>(uint32_t msg_id, uint32_t req_id, const std::vector<uint8_t>& body)>;
116+
117+
void SetInboundHandler(InboundHandler handler);
118+
void DispatchInbound(uint32_t msg_id, uint32_t req_id, std::vector<uint8_t> body);
119+
void WriteResponseSilently(uint32_t resp_msg_id, uint32_t req_id, const std::vector<uint8_t>& body);
120+
static int InboundWorkerCount();
121+
110122
/**
111123
* Send a request and wait for response.
112124
*
@@ -141,17 +153,6 @@ class TCPTransport {
141153
}
142154
};
143155

144-
// ---- Inbound (Agent -> Provider calls) ----
145-
// Read loop only dispatches; handlers run on a bounded worker pool
146-
// (default = hardware concurrency, queue = workers * 4, overflow
147-
// fast-fails with an empty response so Agent failover takes over).
148-
using InboundHandler = std::function<std::vector<uint8_t>(uint32_t msg_id, uint32_t req_id, const std::vector<uint8_t>& body)>;
149-
150-
void SetInboundHandler(InboundHandler handler);
151-
void DispatchInbound(uint32_t msg_id, uint32_t req_id, std::vector<uint8_t> body);
152-
void WriteResponseSilently(uint32_t resp_msg_id, uint32_t req_id, const std::vector<uint8_t>& body);
153-
static int InboundWorkerCount();
154-
155156
void ReadLoop();
156157
int ReadFully(void* buf, size_t count);
157158
static void PutMsgId(uint8_t* buf, uint32_t msg_id);

0 commit comments

Comments
 (0)