#include <wire_reader_impl.h>
Private Member Functions | |
bool connected_ | ABSL_GUARDED_BY (mu_) |
bool recvd_setup_transport_ | ABSL_GUARDED_BY (mu_) |
absl::flat_hash_map< transaction_code_t, int32_t > expected_seq_num_ | ABSL_GUARDED_BY (mu_) |
absl::flat_hash_map< transaction_code_t, std::string > message_buffer_ | ABSL_GUARDED_BY (mu_) |
int64_t num_incoming_bytes_ | ABSL_GUARDED_BY (mu_)=0 |
int64_t num_acknowledged_bytes_ | ABSL_GUARDED_BY (mu_)=0 |
absl::Status | ProcessStreamingTransaction (transaction_code_t code, ReadableParcel *parcel) |
absl::Status | ProcessStreamingTransactionImpl (transaction_code_t code, ReadableParcel *parcel, int *cancellation_flags) ABSL_EXCLUSIVE_LOCKS_REQUIRED(mu_) |
Private Attributes | |
absl::Notification | connection_noti_ |
bool | is_client_ |
grpc_core::Mutex | mu_ |
std::function< void()> | on_destruct_callback_ |
std::unique_ptr< Binder > | other_end_binder_ |
std::shared_ptr< grpc::experimental::binder::SecurityPolicy > | security_policy_ |
std::shared_ptr< TransportStreamReceiver > | transport_stream_receiver_ |
std::unique_ptr< TransactionReceiver > | tx_receiver_ |
std::shared_ptr< WireWriter > | wire_writer_ |
Static Private Attributes | |
static constexpr int64_t | kFlowControlAckBytes = 16 * 1024 |
Additional Inherited Members | |
![]() | |
InternallyRefCounted (const char *trace=nullptr, intptr_t initial_refcount=1) | |
RefCountedPtr< WireReader > | Ref () GRPC_MUST_USE_RESULT |
RefCountedPtr< WireReader > | Ref (const DebugLocation &location, const char *reason) GRPC_MUST_USE_RESULT |
void | Unref () |
void | Unref (const DebugLocation &location, const char *reason) |
~InternallyRefCounted () override=default | |
![]() | |
Orphanable () | |
virtual | ~Orphanable () |
Definition at line 35 of file wire_reader_impl.h.
grpc_binder::WireReaderImpl::WireReaderImpl | ( | std::shared_ptr< TransportStreamReceiver > | transport_stream_receiver, |
bool | is_client, | ||
std::shared_ptr< grpc::experimental::binder::SecurityPolicy > | security_policy, | ||
std::function< void()> | on_destruct_callback = nullptr |
||
) |
Definition at line 75 of file wire_reader_impl.cc.
|
override |
Definition at line 87 of file wire_reader_impl.cc.
|
private |
|
private |
|
private |
|
privatepure virtual |
|
privatepure virtual |
|
inlineoverridevirtual |
Implements grpc_core::Orphanable.
Definition at line 45 of file wire_reader_impl.h.
|
private |
Definition at line 254 of file wire_reader_impl.cc.
|
private |
Definition at line 315 of file wire_reader_impl.cc.
absl::Status grpc_binder::WireReaderImpl::ProcessTransaction | ( | transaction_code_t | code, |
ReadableParcel * | parcel, | ||
int | uid | ||
) |
Definition at line 153 of file wire_reader_impl.cc.
std::unique_ptr< Binder > grpc_binder::WireReaderImpl::RecvSetupTransport | ( | ) |
Recv SETUP_TRANSPORT request.
This is the other half of the SETUP_TRANSPORT process. We wait for in-coming SETUP_TRANSPORT request with the "sending" part of a binder from the other end. For client, the message is coming from the trasnaction receiver we just constructed in SendSetupTransport(). For server, we assume that this step is already completed.
Definition at line 144 of file wire_reader_impl.cc.
void grpc_binder::WireReaderImpl::SendSetupTransport | ( | Binder * | binder | ) |
Send SETUP_TRANSPORT request through binder
.
This is the one half (for client it's the first half, and for server it's the second) of the SETUP_TRANSPORT negotiation process. First, a new binder is created. We take its "receiving" part and construct the transaction receiver with it, and sends the "sending" part along with the SETUP_TRANSPORT message through binder
.
Definition at line 117 of file wire_reader_impl.cc.
|
overridevirtual |
Setup the transport between endpoint binders.
The client and the server both call SetupTransport() when constructing transport.
High-level overview of transaction setup: 0. Client obtains an |endpoint_binder| from the server (in the Android setting, this can be achieved by "binding" to the server APK).
The parameter binder
here means different things for client nad server. For client, binder
refers to |endpoint_binder|, and for server, binder
refers to |client_binder|. That is, for server-side transport setup, we assume that the first half of SETUP_TRANSPORT (up to step 2) is already done somewhere else (see test/end2end/binder_transport_test.cc for how it's handled in the testing environment).
Implements grpc_binder::WireReader.
Definition at line 93 of file wire_reader_impl.cc.
|
private |
Definition at line 108 of file wire_reader_impl.h.
|
private |
Definition at line 120 of file wire_reader_impl.h.
|
staticconstexprprivate |
Definition at line 127 of file wire_reader_impl.h.
|
private |
Definition at line 109 of file wire_reader_impl.h.
|
private |
Definition at line 124 of file wire_reader_impl.h.
|
private |
Definition at line 114 of file wire_reader_impl.h.
|
private |
Definition at line 121 of file wire_reader_impl.h.
|
private |
Definition at line 107 of file wire_reader_impl.h.
|
private |
Definition at line 119 of file wire_reader_impl.h.
|
private |
Definition at line 132 of file wire_reader_impl.h.