diff options
author | Wyatt Hepler <hepler@google.com> | 2021-10-20 11:05:06 -0700 |
---|---|---|
committer | CQ Bot Account <pigweed-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2021-10-21 01:51:33 +0000 |
commit | 1d000cc1cf0d3ffc8dd167c11c1cb129ce78f439 (patch) | |
tree | db0bdc7706a1ead7c36434d199518362db613431 /pw_rpc/endpoint.cc | |
parent | 36986c0d87a51bf725b6d98de2311dcc95053652 (diff) | |
download | pigweed-1d000cc1cf0d3ffc8dd167c11c1cb129ce78f439.tar.gz |
pw_rpc: Move server/client calls to separate files
- Move the server/client calls to improve code organization and make
upcoming lock annotations simpler, since the Endpoint class is fully
defined in the server/client call headers.
- No longer have the server respond to a cancel for an unknown call.
There is no point in sending an error for that RPC to the client
because the client cancelled it and won't know about that call by the
time it gets the error. In general, error packets should only be sent
when an RPC fails to start or needs to be terminated.
- Use PW_TRY_ASSIGN in the server and client.
Change-Id: I467d06ef7139a5698be0b30e9ed1bac3a625e02e
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/66201
Commit-Queue: Wyatt Hepler <hepler@google.com>
Pigweed-Auto-Submit: Wyatt Hepler <hepler@google.com>
Reviewed-by: Alexei Frolov <frolv@google.com>
Diffstat (limited to 'pw_rpc/endpoint.cc')
-rw-r--r-- | pw_rpc/endpoint.cc | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/pw_rpc/endpoint.cc b/pw_rpc/endpoint.cc index fa765e30c..25cec031a 100644 --- a/pw_rpc/endpoint.cc +++ b/pw_rpc/endpoint.cc @@ -27,8 +27,7 @@ Endpoint::~Endpoint() { } Result<Packet> Endpoint::ProcessPacket(std::span<const std::byte> data, - Packet::Destination destination, - Call*& ongoing_call) { + Packet::Destination destination) { Result<Packet> result = Packet::FromBuffer(data); if (!result.ok()) { @@ -48,9 +47,6 @@ Result<Packet> Endpoint::ProcessPacket(std::span<const std::byte> data, return Status::InvalidArgument(); } - // Find an existing reader/writer for this RPC, if any. - ongoing_call = FindCall(packet); - return result; } |