fix: do not send a reply to a remote endpoint if the the connection has failed

This commit is contained in:
Evan Tschannen 2021-09-15 23:53:10 -07:00
parent 5d2c86d87c
commit 4f14e08547
1 changed files with 3 additions and 0 deletions

View File

@ -413,6 +413,9 @@ public:
template <class U>
void send(U&& value) const {
if (queue->isRemoteEndpoint()) {
if (queue->acknowledgements.failures.isError()) {
throw queue->acknowledgements.failures.getError();
}
if (!queue->acknowledgements.getRawEndpoint().isValid()) {
// register acknowledge receiver on sender and tell the receiver where to send acknowledge messages
value.acknowledgeToken = queue->acknowledgements.getEndpoint(TaskPriority::ReadSocket).token;