fix: block when free socket

This commit is contained in:
DeEMO
2025-06-12 12:26:10 +00:00
committed by DeEMO
parent 2039e3b0c1
commit d4618de991
2 changed files with 21 additions and 6 deletions
+6 -2
View File
@@ -20776,9 +20776,13 @@ int llama_rebuild_topo(llama_context * ctx,
int llama_forward_messages(llama_context *ctx) {
zmq::message_t message;
int more = true;
int timeout_ms = 10;
ctx->recv_socket->setsockopt(ZMQ_RCVTIMEO, &timeout_ms, sizeof(timeout_ms));
while (more) {
ctx->recv_socket->recv(message, zmq::recv_flags::none);
auto recv_result = ctx->recv_socket->recv(message, zmq::recv_flags::none);
if (!recv_result) {
return -1;
}
size_t more_size = sizeof(more);
ctx->recv_socket->getsockopt(ZMQ_RCVMORE, &more, &more_size);