From f7cf4be9958b720b8d072e44c754a058a38045dc Mon Sep 17 00:00:00 2001 From: Dean Lee Date: Wed, 6 Oct 2021 20:04:51 +0800 Subject: [PATCH] repaly: stop publish socket on multiple publishers error (#22449) --- selfdrive/ui/replay/replay.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/selfdrive/ui/replay/replay.cc b/selfdrive/ui/replay/replay.cc index d6354dbbe3..26588bde2e 100644 --- a/selfdrive/ui/replay/replay.cc +++ b/selfdrive/ui/replay/replay.cc @@ -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}}); }