repaly: stop publish socket on multiple publishers error (#22449)

pull/22450/head
Dean Lee 2021-10-06 20:04:51 +08:00 committed by GitHub
parent 261d51de41
commit f7cf4be995
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -264,7 +264,10 @@ void Replay::stream() {
// publish msg
if (sm == nullptr) {
auto bytes = evt->bytes();
pm->send(sockets_[cur_which], (capnp::byte *)bytes.begin(), bytes.size());
if (-1 == pm->send(sockets_[cur_which], (capnp::byte *)bytes.begin(), bytes.size())) {
qDebug() << "stop publish" << sockets_[cur_which] << "due to multiple publishers error";
sockets_[cur_which] = nullptr;
}
} else {
sm->update_msgs(nanos_since_boot(), {{sockets_[cur_which], evt->event}});
}