Skip to content
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

Iox #27 1 client server port interfaces #275

Merged

Conversation

budrus
Copy link
Contributor

@budrus budrus commented Sep 7, 2020

initial PR for #27, step 1 in the list

  • API proposal for review
  • no implementation yet
  • also some cleanup in naming of our config parameters
  • when renaming, I realized that ChunSender template parameter has to be ChunkSenderData and not ChunkDistributor and same issue for ChunkReceiver.

Poehnl Michael (CC-AD/ESW1) added 9 commits September 4, 2020 17:40
Signed-off-by: Poehnl Michael (CC-AD/ESW1) <michael.poehnl@de.bosch.com>
Signed-off-by: Poehnl Michael (CC-AD/ESW1) <michael.poehnl@de.bosch.com>
Signed-off-by: Poehnl Michael (CC-AD/ESW1) <michael.poehnl@de.bosch.com>
Signed-off-by: Poehnl Michael (CC-AD/ESW1) <michael.poehnl@de.bosch.com>
Signed-off-by: Poehnl Michael (CC-AD/ESW1) <michael.poehnl@de.bosch.com>
Signed-off-by: Poehnl Michael (CC-AD/ESW1) <michael.poehnl@de.bosch.com>
Signed-off-by: Poehnl Michael (CC-AD/ESW1) <michael.poehnl@de.bosch.com>
Signed-off-by: Poehnl Michael (CC-AD/ESW1) <michael.poehnl@de.bosch.com>
Signed-off-by: Poehnl Michael (CC-AD/ESW1) <michael.poehnl@de.bosch.com>

/// @brief check if there was a queue overflow since the last call of hasLostResponseChunks
/// @return true if the underlying queue overflowed since last call of this method, otherwise false
bool hasLostResponses() noexcept;
Copy link
Contributor

Choose a reason for hiding this comment

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

This method should be const.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

this will reset the flag in ChunkQueueData, and I would not make it mutable because this is a state change for the user

}

private:
int64_t m_sequenceNumber{0};
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is the sequence number not an uint64_t. Do we have negative sequence numbers?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

because I saw that ROS is using an int64....

Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe it's worth raising a PR in rcl? O:-) Or where did you find it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Poehnl Michael (CC-AD/ESW1) added 3 commits September 10, 2020 15:21
Signed-off-by: Poehnl Michael (CC-AD/ESW1) <michael.poehnl@de.bosch.com>
Signed-off-by: Poehnl Michael (CC-AD/ESW1) <michael.poehnl@de.bosch.com>
Comment on lines +41 to +42
ClientPortRouDi(ClientPortRouDi&& rhs) = default;
ClientPortRouDi& operator=(ClientPortRouDi&& rhs) = default;
Copy link
Contributor

Choose a reason for hiding this comment

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

noexcept missing?

Copy link
Contributor Author

@budrus budrus Sep 10, 2020

Choose a reason for hiding this comment

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

Good question. I saw that we normally don't have the no except keyword for the default c'tors. We didn't do that when we had the big noexcept refactoring last year. So if it shall be no except we have to change > 100 files I guess. I would do it in a separate PR if we decide to go this way
@elfenpiff @elBoberido your opinion?

Copy link
Contributor

@mossmaurice mossmaurice Sep 11, 2020

Choose a reason for hiding this comment

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

IMHO we should always try to be explicit as possible. Then we are aligned with MISRA and the AUTOSAR rules most of the time.
Standard says default c'tors are mostly not throwing, however, there are some exemptions http://eel.is/c++draft/except.spec#7 I'll vote for the explicit way. I'll check ISO/IEC14882:2014 (C++14)

Copy link
Contributor

Choose a reason for hiding this comment

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

Cppref also provides a good read on this topic: https://en.cppreference.com/w/cpp/language/noexcept_spec

Copy link
Contributor

Choose a reason for hiding this comment

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

As @mossmaurice said "c'tors are mostly not throwing", which means some still can. So it's probably good to be explicit.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will not be handled here, I added it to #130

}

private:
int64_t m_sequenceNumber{0};
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe it's worth raising a PR in rcl? O:-) Or where did you find it?

relative_ptr<ClientChunkQueueData_t> m_responseQueue;
};

class ResponseHeader
Copy link
Contributor

Choose a reason for hiding this comment

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

Move class to its own file

Copy link
Contributor Author

Choose a reason for hiding this comment

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

will do when I implement things. This was just the API so far

Copy link
Contributor

Choose a reason for hiding this comment

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

Well, it's not a big deal to create a new file, isn't it? ;-) But no hard feelings on this, but IMHO it would be cleaner start.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure. My intention was also to get feedback on the general interface. Maybe it would have turned out that the request and response headers are no good idea. So I wanted to save effort until it is consolidated

{
return m_chunkReceiver.get();
return m_chunkReceiver.tryGet();
Copy link
Contributor

Choose a reason for hiding this comment

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

Try to get what? Bananas or apples?

Copy link
Contributor Author

@budrus budrus Sep 10, 2020

Choose a reason for hiding this comment

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

A chunk receiver gets chunks. somehow obvious. On the next API layer we are more precise and have allocateChunk. I was thinking about that when I implemented the ChunkReceiver. But then decided against it as I felt it is somehow redundant. The ChunkReceiver has only one job and this is receiving chunks. So I thought get() gets a chunk. Like open() for a Door class and not openDoor()

constexpr uint64_t SHARED_MEMORY_ALIGNMENT = 32u;
constexpr uint32_t MAX_NUMBER_OF_MEMPOOLS = 32u;
constexpr uint32_t MAX_SHM_SEGMENTS = 100u;
constexpr uint64_t SHARED_MEMORY_ALIGNMENT = 32U;
Copy link
Contributor

Choose a reason for hiding this comment

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

I like capital literals. Makes it harder to confuse a "one" and a lower case L. So, that's the new style for iceoryx! 👍

Poehnl Michael (CC-AD/ESW1) added 6 commits September 10, 2020 16:53
Signed-off-by: Poehnl Michael (CC-AD/ESW1) <michael.poehnl@de.bosch.com>
Signed-off-by: Poehnl Michael (CC-AD/ESW1) <michael.poehnl@de.bosch.com>
Signed-off-by: Poehnl Michael (CC-AD/ESW1) <michael.poehnl@de.bosch.com>
Signed-off-by: Poehnl Michael (CC-AD/ESW1) <michael.poehnl@de.bosch.com>
Signed-off-by: Poehnl Michael (CC-AD/ESW1) <michael.poehnl@de.bosch.com>
Signed-off-by: Poehnl Michael (CC-AD/ESW1) <michael.poehnl@de.bosch.com>
@budrus budrus requested a review from mossmaurice September 11, 2020 07:48
@mossmaurice mossmaurice added the enhancement New feature label Sep 11, 2020
Poehnl Michael (CC-AD/ESW1) added 4 commits September 11, 2020 15:43
Signed-off-by: Poehnl Michael (CC-AD/ESW1) <michael.poehnl@de.bosch.com>
Signed-off-by: Poehnl Michael (CC-AD/ESW1) <michael.poehnl@de.bosch.com>
Signed-off-by: Poehnl Michael (CC-AD/ESW1) <michael.poehnl@de.bosch.com>
Signed-off-by: Poehnl Michael (CC-AD/ESW1) <michael.poehnl@de.bosch.com>
mossmaurice
mossmaurice previously approved these changes Sep 14, 2020
Copy link
Contributor

@mossmaurice mossmaurice left a comment

Choose a reason for hiding this comment

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

LGTM, having RPCBaseHeader, RequestHeader and ResponseHeader in their own hpp and cpp would be nice. You might want to do it now or in the follow-up pull request.

elfenpiff
elfenpiff previously approved these changes Sep 14, 2020
Signed-off-by: Poehnl Michael (CC-AD/ESW1) <michael.poehnl@de.bosch.com>
@budrus budrus dismissed stale reviews from elfenpiff and mossmaurice via e3d6212 September 14, 2020 11:08
constexpr uint32_t MAX_CLIENTS_PER_SERVER = 256U;
constexpr uint32_t MAX_REQUESTS_PROCESSED_SIMULTANEOUSLY = 4U;
constexpr uint32_t MAX_RESPONSES_ALLOCATED_SIMULTANEOUSLY = MAX_REQUESTS_PROCESSED_SIMULTANEOUSLY;
constexpr uint32_t MAX_REQUEST_QUEUE_CAPACITY = 1024;
Copy link
Member

Choose a reason for hiding this comment

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

Missing U

@budrus budrus merged commit 8bd8b70 into eclipse-iceoryx:master Sep 14, 2020
@budrus budrus linked an issue Sep 14, 2020 that may be closed by this pull request
22 tasks
@budrus budrus deleted the iox-#27-1-client_server_port_interfaces branch November 6, 2020 11:59
@hemalbavishi
Copy link

Hello,

We've requirement related to request/response communication and would like to know when this solution would be available?

@budrus
Copy link
Contributor Author

budrus commented Nov 6, 2020

Hello,

We've requirement related to request/response communication and would like to know when this solution would be available?

Thanks for asking @hemalbavishi. Top prio has the new C and C++ API for pub/sub communication. This we want to finalize in the next weeks and this is prio 1. But request/response is the next on the list. I would assume that we have a first version end of this or latest beginning of next year

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Request/Response communication with iceoryx
8 participants