Android-cuttlefish cvd tool
channel_sharedfd.h
Go to the documentation of this file.
1/*
2 * Copyright 2023 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#pragma once
18
21
22namespace cuttlefish::transport {
23
24class SharedFdChannel : public Channel {
25 public:
26 SharedFdChannel(SharedFD input, SharedFD output);
27 Result<void> SendRequest(RawMessage& message) override;
28 Result<void> SendResponse(RawMessage& message) override;
30 Result<int> WaitForMessage() override;
31
32 private:
35
36 Result<void> SendMessage(RawMessage& message, bool response);
37};
38
39} // namespace cuttlefish::transport
Definition: shared_fd.h:124
Definition: channel.h:66
Definition: channel_sharedfd.h:24
Result< void > SendMessage(RawMessage &message, bool response)
Definition: channel_sharedfd.cpp:80
Result< int > WaitForMessage() override
Definition: channel_sharedfd.cpp:68
SharedFD output_
Definition: channel_sharedfd.h:34
SharedFD input_
Definition: channel_sharedfd.h:33
SharedFdChannel(SharedFD input, SharedFD output)
Definition: channel_sharedfd.cpp:36
Result< ManagedMessage > ReceiveMessage() override
Definition: channel_sharedfd.cpp:49
Result< void > SendRequest(RawMessage &message) override
Definition: channel_sharedfd.cpp:39
Result< void > SendResponse(RawMessage &message) override
Definition: channel_sharedfd.cpp:44
Definition: channel.cpp:27
tl::expected< T, StackTraceError > Result
Definition: result_type.h:30
Definition: channel.h:34