Skip to content

Conversation

@serges147
Copy link
Contributor

@serges147 serges147 commented Jan 24, 2025

  1. Response Rx Session now doesn't own lizard's rpc port subscription - instead now session references the shared subscription (with reference counting).
  2. Transport delegates now manage subscriptions.
  3. CAN Response Rx Sessions now stored in cavl tree (for UDP it was already like this) - matching now by both port and node ids (previously it was by the port only).
  4. CAN filters now also are made by the delegate (b/c it knows about subscriptions (see bullet # 2).
  5. Extended unit tests to cover multiple response Rx sessions (both CAN and UDP). Also covered unsolicited responses.

Github's Hide whitespaces is recommended.

@serges147 serges147 self-assigned this Jan 27, 2025
@serges147 serges147 changed the title Fixed UDP part Fix for issue #412 Only one single RPC client is possible per port Jan 27, 2025
Copy link
Contributor

@thirtytwobits thirtytwobits left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good. Mostly cosmetic comments.

}

template <typename Action>
bool performWithoutThrowing(Action&& action) noexcept
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CETL_NODISCARD

std::forward<Action>(action)();
return true;
#if defined(__cpp_exceptions)
} catch (...)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

catch all isn't acceptable. Let's templatize this with base exceptions that are thrown.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should also add a debug macro to allow inserting asserts, breakpoints, or logging for any squelched exception.

return rx_rpc_dispatcher_;
}

void listenForRxRpcPort(UdpardRxRPCPort& rpc_port, const RequestRxParams& params)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you could avoid the code duplication here by specializing on a private template method with a "is_request" parameter.

#if defined(__cpp_exceptions)
} catch (const Exception& ex)
{
CETL_DEBUG_ASSERT(false, ex.what());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry but I was thinking this was distinct from the debug assert. Failures may be recoverable and this would lower the utility of debug assert which should be used for "this should never happen" cases only. Uh...just remove this line and ignore my previous request. Sorry.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

@sonarqubecloud
Copy link

@thirtytwobits thirtytwobits merged commit e33cdb7 into issue/412_rpc_clients Jan 28, 2025
22 checks passed
@thirtytwobits thirtytwobits deleted the sshirokov/412_rpc_clients branch January 28, 2025 17:22
serges147 added a commit that referenced this pull request Jan 28, 2025
) (#417)

1. Response Rx Session now doesn't own lizard's rpc port subscription -
instead now session references the shared subscription (with reference
counting).
2. Transport delegates now manage subscriptions.
3. CAN Response Rx Sessions now stored in cavl tree (for UDP it was
already like this) - matching now by both port and node ids (previously
it was by the port only).
4. CAN filters now also are made by the delegate (b/c it knows about
subscriptions (see bullet # 2).
5. Extended unit tests to cover multiple response Rx sessions (both CAN
and UDP). Also covered unsolicited responses.

Github's Hide whitespaces is recommended.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants