Skip to content

feat: Add sd_bus_message_get_cookie (#490) #491

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 5, 2025

Conversation

howey
Copy link
Contributor

@howey howey commented Apr 23, 2025

Add sd_bus_message_get_cookie() and sd_bus_message_get_reply_cookie() as Message::getCookie() and Message::getReplyCookie().

@sangelovic sangelovic self-assigned this Apr 23, 2025
@howey howey force-pushed the feat/sd-bus-cookie branch from 3daf683 to d44abf6 Compare April 23, 2025 21:45
@sangelovic
Copy link
Collaborator

I'm also thinking about a new (integration) test case verifying this feature and showing how the serial number in a method call message would match a serial number in the reply message. Not sure how familiar are you with the tests... I may help you here by writing it and pushing to your branch.

@howey
Copy link
Contributor Author

howey commented Apr 23, 2025

Sure, go ahead. This is roughly my code

  auto callback = [](sdbus::MethodReply reply, std::optional<sdbus::Error> error) {
    auto n = reply.getReplyCookie();
    std::cerr << "reply cookie " << n << std::endl;
  };

  for (int i = 0; i < 3; i++) {
    auto method = proxy->createMethodCall(interfaceName, methodName);
    proxy->callMethodAsync(method, callback);

    auto n = method.getCookie();
    std::cerr << "method cookie " << n << std::endl;
  }

@sangelovic
Copy link
Collaborator

OK thanks, will do tomorrow.

Dylan Howey and others added 2 commits May 5, 2025 07:53
Add sd_bus_message_get_cookie() and sd_bus_message_get_reply_cookie() as
Message::getCookie() and Message::getReplyCookie().
@sangelovic sangelovic force-pushed the feat/sd-bus-cookie branch from 25241dc to 065ec8d Compare May 5, 2025 05:54
@sangelovic
Copy link
Collaborator

sangelovic commented May 5, 2025

Sorry, took me longer than anticipated, busy with other things :-) But now the test is there, the CI is passing, so let's go ;-)

@sangelovic sangelovic merged commit 6212b12 into Kistler-Group:master May 5, 2025
9 checks passed
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.

2 participants