mirror of
https://github.com/mutouyun/cpp-ipc.git
synced 2025-12-06 16:56:45 +08:00
send之前还是应该简单检查连接个数
This commit is contained in:
parent
6163618433
commit
f2335bb38b
@ -435,6 +435,10 @@ static bool send(F&& gen_push, ipc::handle_t h, void const * data, std::size_t s
|
|||||||
ipc::error("fail: send, que->ready_sending() == false\n");
|
ipc::error("fail: send, que->ready_sending() == false\n");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
if (que->elems()->connections(std::memory_order_relaxed) == 0) {
|
||||||
|
ipc::error("fail: send, there is no receiver on this connection.\n");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
// calc a new message id
|
// calc a new message id
|
||||||
auto acc = info_of(h)->acc();
|
auto acc = info_of(h)->acc();
|
||||||
if (acc == nullptr) {
|
if (acc == nullptr) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user